<template>
  <div>
    <a-form-model
      :model="form"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
      :class="prohibit ? 'prohibit-cu' : ''"
      v-if="sctiveType == 'feedBaseband'"
      :rules="rules"
    >
      <a-tabs  v-model="form.JDNo" @change="callback">
        <a-tab-pane :key="2" tab="基带1"> </a-tab-pane>
        <a-tab-pane :key="3" tab="基带2"></a-tab-pane>
        <a-tab-pane :key="4" tab="基带3"> </a-tab-pane>
        <a-tab-pane :key="5" tab="基带4"> </a-tab-pane>
      </a-tabs>
      <div
        v-if="prohibit"
        :class="prohibit ? 'prohibit' : ''"
        style="width: 100%; display: flex; justify-content: space-around"
      >
        <a-row style="width: 49%">
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="设备序列号">
                <a-input v-model="form.workingData1" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="电压">
                <div style="display: flex; align-items: center">
                  <a-input style="width: 100%" v-model="form.workingData2" suffix="V" />
                  <!-- <span> V </span> -->
                </div>
              </a-form-model-item>
            </a-col>
          </a-row>

          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行接收功率">
                <a-input v-model="form.workingData4" suffix="dBm" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行信噪比">
                <a-input v-model="form.workingData5" suffix="dB" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行速率">
                <a-input v-model="form.workingData6" suffix="bps" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行 Eb/N0">
                <a-input v-model="form.workingData7" suffix="dB" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行自动调制编码">
                <a-input v-model="form.workingData3" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行载波同步">
                <a-input v-model="form.workingData8" />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-row>
        <a-row style="width: 49%">
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行位同步">
                <a-input v-model="form.workingData9" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行帧同步">
                <a-input v-model="form.workingData10" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行链路状态">
                <a-input v-model="form.workingData11" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="上行发送帧计数">
                <a-input v-model="form.workingData12" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="下行接收帧计数">
                <a-input v-model="form.workingData13" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="接收协议网关帧计数">
                <a-input v-model="form.workingData14" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="发射协议网关帧计数">
                <a-input v-model="form.workingData15" />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-row>
      </div>

      <div
        v-if="!prohibit"
        :class="prohibit ? 'prohibit' : ''"
        style="width: 100%; display: flex; justify-content: space-around"
      >
        <a-card title="单元设置参数" style="width: 49%">
          <a-row>
            <a-row>
              <a-col :span="20">
                <a-form-model-item label="启动开关">
                  <a-switch
                    checked-children="开"
                    un-checked-children="关"
                    default-checked
                    v-model="form.parameter1"
                  />
                    <!-- <a-switch
                    checked-children="开"
                    un-checked-children="关"
                    default-checked
                    v-model="form.parameter1"
                    @change="handleConfig(1)"
                  /> -->

                  <!-- <a-select v-model="form.parameter1" style="width: 100%">
                    <a-select-option value="00"> 关闭 </a-select-option>
                    <a-select-option value="01"> 开启 </a-select-option>
                  </a-select> -->
                </a-form-model-item>
              </a-col>
            </a-row>
             <a-row>
                <a-col :span="20">
                  <a-form-model-item label="下行中心频点">
                    <div style="display: flex; align-items: center">
                      <a-input-number
                        :min="1.1"
                        :max="2.1"
                        :step="0.1"
                        placeholder="请输入1.1-2.1GHz"
                        suffix="GHz"
                        style="width: 100%"
                        v-model="form.parameter8"
                      />
                    </div>
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="20">
                  <a-form-model-item label="下行符号速率">
                    <a-select v-model="form.parameter9" style="width: 100%">
                      <a-select-option value="01"> 187.5 Msps </a-select-option>
                      <a-select-option value="02"> 375 Msps </a-select-option>
                      <a-select-option value="03"> 750 Msps </a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-col>
              </a-row>
               <a-row>
                <a-col :span="20">
                  <a-form-model-item label="下行调制编码模式">
                    <a-select v-model="form.parameter10" style="width: 100%">
                      <a-select-option value="01"> VCM 模式</a-select-option>
                      <a-select-option value="02"> ACM 模式 </a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-col>
              </a-row>
               <a-row>
              <a-col :span="20">
                <a-form-model-item label="卫星调制编码组合">
                  <a-select v-model="form.parameter19" style="width: 100%">
                    <a-select-option value="01"> 16APSK LDPC 7/8 </a-select-option>
                    <a-select-option value="02"> 16APSK LDPC 3/4 </a-select-option>
                    <a-select-option value="03"> 8PSK LDPC 3/4 </a-select-option>
                    <a-select-option value="04"> QPSK LDPC 7/8 </a-select-option>
                    <a-select-option value="05"> QPSK LDPC 3/4 </a-select-option>
                    <a-select-option value="06"> QPSK LDPC 1/2_1 </a-select-option>
                    <a-select-option value="07"> QPSK LDPC 1/2_2 </a-select-option>
                    <a-select-option value="08"> QPSK LDPC 1/2_4 </a-select-option>
                    <a-select-option value="09"> QPSK LDPC 1/2_8 </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(6)"> 设置 </a-button>
              </a-col> -->
            </a-row>
              <!-- <a-row>
                <a-col :span="20">
                  <a-form-model-item label="下行调制编码组合">
                    <a-select v-model="form.parameter10" style="width: 100%">
                      <a-select-option value="01"> 16APSK LDPC 7/8 </a-select-option>
                      <a-select-option value="02"> 16APSK LDPC 3/4 </a-select-option>
                      <a-select-option value="03"> 8PSK LDPC 3/4 </a-select-option>
                      <a-select-option value="04"> QPSK LDPC 7/8 </a-select-option>
                      <a-select-option value="05"> QPSK LDPC 3/4 </a-select-option>
                      <a-select-option value="06"> QPSK LDPC 1/2_1 </a-select-option>
                      <a-select-option value="07"> QPSK LDPC 1/2_2 </a-select-option>
                      <a-select-option value="08"> QPSK LDPC 1/2_4 </a-select-option>
                      <a-select-option value="09"> QPSK LDPC 1/2_8 </a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-col>
              </a-row> -->

            <a-row>
              <a-col :span="20">
                <a-form-model-item label="上行中心频点">
                  <div style="display: flex; align-items: center">
                    <a-input-number
                      :min="1.1"
                      :max="2.1"
                      :step="0.1"
                      placeholder="请输入1.1-2.1GHz"
                      suffix="GHz"
                      style="width: 100%"
                      v-model="form.parameter3"
                    >
                      <!-- <a-select slot="addonAfter" default-value="KHz" style="width: 70px">
                        <a-select-option value="KHz"> KHz </a-select-option>
                        <a-select-option value="MHz"> MHz </a-select-option>
                        <a-select-option value="GHz"> GHz </a-select-option>
                      </a-select> -->
                    </a-input-number>
                    <!-- <span> KHZ </span> -->
                  </div>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(3)"> 设置 </a-button>
              </a-col> -->
            </a-row>

             <a-row>
              <a-col :span="20">
                <a-form-model-item label="上行符号速率">
                  <a-select v-model="form.parameter4" style="width: 100%">
                    <a-select-option value="01"> 187.5 Msps </a-select-option>
                    <a-select-option value="02"> 375 Msps </a-select-option>
                    <a-select-option value="03"> 750 Msps </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(4)"> 设置 </a-button>
              </a-col> -->
            </a-row>
            <a-row>
              <a-col :span="20">
                <a-form-model-item label="上行调制编码模式">
                  <a-select v-model="form.parameter5" style="width: 100%">
                    <a-select-option value="00"> VCM 模式 </a-select-option>
                    <a-select-option value="01"> ACM 模式 </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(5)"> 设置 </a-button>
              </a-col> -->
            </a-row>
          <a-row>
              <a-col :span="20">
                <a-form-model-item label="基带调制编码组合">
                  <a-select v-model="form.parameter6" style="width: 100%">
                    <a-select-option value="01"> 16APSK LDPC 7/8 </a-select-option>
                    <a-select-option value="02"> 16APSK LDPC 3/4 </a-select-option>
                    <a-select-option value="03"> 8PSK LDPC 3/4 </a-select-option>
                    <a-select-option value="04"> QPSK LDPC 7/8 </a-select-option>
                    <a-select-option value="05"> QPSK LDPC 3/4 </a-select-option>
                    <a-select-option value="06"> QPSK LDPC 1/2_1 </a-select-option>
                    <a-select-option value="07"> QPSK LDPC 1/2_2 </a-select-option>
                    <a-select-option value="08"> QPSK LDPC 1/2_4 </a-select-option>
                    <a-select-option value="09"> QPSK LDPC 1/2_8 </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(6)"> 设置 </a-button>
              </a-col> -->
            </a-row>

          <a-row>
              <a-col :span="20">
                <a-form-model-item label="上行调整功率模式">
                  <a-select v-model="form.parameter7" style="width: 100%">
                    <a-select-option value="01"> 固定功率 </a-select-option>
                    <a-select-option value="02"> 自动功率 </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(7)"> 设置 </a-button>
              </a-col> -->
            </a-row>
            <a-row>
              <a-col :span="20">
                <a-form-model-item label="上行发送功率">
                  <div style="display: flex; align-items: center">
                    <a-input style="width: 100%" v-model="form.parameter2" suffix="dBm" />
                    <!-- <span> DBM </span> -->
                  </div>
                  <!-- <a-input v-model="form.DemodulationIP" /> -->
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(2)"> 设置 </a-button>
              </a-col> -->
            </a-row>

              <a-row>
                      <a-col :span="20">
                        <a-form-model-item label="单载波和调制信号切换">
                          <a-select v-model="form.parameter14" style="width: 100%">
                            <a-select-option value="00"> 单载波 </a-select-option>
                            <a-select-option value="01"> 调制信号 </a-select-option>
                          </a-select>
                        </a-form-model-item>
                      </a-col>
                      <!-- <a-col :span="4" v-if="!prohibit">
                        <a-button type="primary" icon="setting" style @click="handleConfig(14)"> 设置 </a-button>
                      </a-col> -->
                    </a-row>
            <a-row>
                    <a-col :span="20">
                      <a-form-model-item label="频偏预补偿开关">
                        <a-select v-model="form.parameter13" style="width: 100%">
                          <a-select-option value="00"> 频偏预补偿关闭 </a-select-option>
                          <a-select-option value="01"> 自动频偏预补偿 </a-select-option>
                          <a-select-option value="02"> 手动频偏预补偿 </a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                    <!-- <a-col :span="4" v-if="!prohibit">
                      <a-button type="primary" icon="setting" style @click="handleConfig(13)"> 设置 </a-button>
                    </a-col> -->
                  </a-row>


            <a-row>
              <a-col :span="20">
                <a-form-model-item label="频偏预补偿值">
                  <div style="display: flex; align-items: center">
                    <a-input-number
                      style="width: 100%"
                      v-model="form.parameter12"
                      suffix="MHz"
                      :min="-1.2"
                      :max="1.2"
                      :step="0.1"
                      placeholder="输入-1.2MHz~+1.2MHz"
                    />
                    <!-- <span> HZ </span> -->
                  </div>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(12)"> 设置 </a-button>
              </a-col> -->
            </a-row>


                    <a-row>
              <a-col :span="20">
                <a-form-model-item label="频谱倒置">
                  <a-select v-model="form.parameter18" style="width: 100%">
                    <a-select-option value="01"> 倒置 </a-select-option>
                    <a-select-option value="02"> 不导致 </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <!-- <a-col :span="4" v-if="!prohibit">
                <a-button type="primary" icon="setting" style @click="handleConfig(14)"> 设置 </a-button>
              </a-col> -->
            </a-row>
             <a-row>
              <a-col :span='20' :offset='20' style="display:flex">
                <a-button style="justify-self:flex-end" type='primary' @click="handleConfigKD()">设置</a-button>
              </a-col>
            </a-row>
          </a-row>
        </a-card>
        <div style="width: 49%">
          <a-card title="误码对比清零控制命令">
            <a-row>

              <a-row>
                <a-col :span="20">
                  <a-form-model-item label="">
                         <a-button type="primary" style @click="handleConfigWML()"> 误码率清零 </a-button>

                    <!-- <a-select
                    v-model="form.parameter11"
                    default-value="01"
                    style="width: 100%"
                  >
                    <a-select-option value="01">
                      误码率清零
                    </a-select-option>
                  </a-select> -->
                    <!-- <a-button type="primary" style @click="handleConfig(11)"> 误码率清零 </a-button> -->
                  </a-form-model-item>
                </a-col>
                <!-- <a-col :span="4" v-if="!prohibit">
                <a-button
                  type="primary"
                  icon="setting"
                  style
                  @click="handleConfig(11)"
                >
                  设置
                </a-button>
              </a-col> -->
              </a-row>
            </a-row>
          </a-card>
          <a-card title="设置业务网络" style="width: 100%">
            <a-row style="margin-top: 5px">
              <a-row>
                <a-col :span="20">
                  <a-form-model-item label="业务网络IP地址" prop="parameter15">
                    <a-input v-model="form.parameter15" />
                  </a-form-model-item>
                </a-col>
                <!-- <a-col :span="4" v-if="!prohibit">
                <a-button
                  type="primary"
                  icon="setting"
                  style
                  @click="handleConfig(15)"
                >
                  设置
                </a-button>
              </a-col> -->
              </a-row>

              <a-row>
                <a-col :span="20">
                  <a-form-model-item label="业务网络子网掩码" prop="parameter17">
                    <a-input v-model="form.parameter17" />
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="20">
                  <a-form-model-item label="业务网络端口号">
                    <a-input v-model="form.parameter16" />
                  </a-form-model-item>
                </a-col>
                <!-- <a-col :span="4" v-if="!prohibit">
                <a-button
                  type="primary"
                  icon="setting"
                  style
                  @click="handleConfig(16)"
                >
                  设置
                </a-button>
              </a-col> -->
              </a-row>
              <a-row style="float: right">
                <a-col :span="4" v-if="!prohibit">
                  <a-button type="primary" icon="setting" @click="handleConfig(17)"> 设置 </a-button>
                </a-col>
              </a-row>
            </a-row>
          </a-card>
        </div>
      </div>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 22 }" v-if="false">
        <a-button type="primary" @click="onSubmit">全部配置</a-button>
        <!-- <a-button style="margin-left: 10px"> Cancel </a-button> -->
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form"
      :label-col="labelCol1"
      :wrapper-col="wrapperCol1"
      :rules="rules"
      v-if="sctiveType == 'BCode'"
    >
    <a-row  v-if="!prohibit">
     <a-form-model-item label="IP">
        <a-input v-model="form.BIp" />
      </a-form-model-item>
      <a-form-model-item label="端口">
        <a-input v-model="form.Bport" />
        <!-- <a-select v-model="form.antenna">
            <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
          </a-select> -->
      </a-form-model-item>
    </a-row>
    <a-row  v-else>
        <a-form-model-item label="时间">
          <a-input v-model="form.Btime" />
        </a-form-model-item>
        <a-form-model-item label="IP1">
          <a-input v-model="form.BIp" />
        </a-form-model-item>
        <a-form-model-item label="端口">
          <a-input v-model="form.Bport" />
          <!-- <a-select v-model="form.antenna">
              <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
            </a-select> -->
        </a-form-model-item>
    </a-row>
   
      <a-form-model-item :wrapper-col="{ span: 12, offset: 20 }" v-if="!prohibit">
        <a-button type="primary" @click="onSubmitAllConfigMatrixData">全部配置</a-button>
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form"
      :label-col="labelCol1"
      :wrapper-col="wrapperCol1"
      :rules="rules"
      v-if="sctiveType == 'commone'"
    >
      <a-form-model-item label="载荷ID">
        <a-input v-model="form.LoadID" />
        <!-- <a-select v-model="form.antenna">
            <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
          </a-select> -->
      </a-form-model-item>
      <a-form-model-item label="上行同步状态">
        <a-input v-model="form.StatuUp" />
        <!-- <a-select v-model="form.antenna">
            <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
          </a-select> -->
      </a-form-model-item>
      <a-form-model-item label="下行同步状态">
        <a-input v-model="form.StatuDown" />
      </a-form-model-item>
      <a-form-model-item label="上行误码率">
        <a-input v-model="form.UplinkErrorRate" />
      </a-form-model-item>
      <a-form-model-item label="下行误码率">
        <a-input v-model="form.DownlinkErrorRate" />
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form"
      :label-col="labelCol1"
      :wrapper-col="wrapperCol1"
      :rules="rules"
      v-if="sctiveType == 'ProtocolGateway'"
    >
      <a-row v-if="prohibit">
        <a-table :columns="columns1" rowKey="id" size="small" :data-source="data1" :pagination="false" bordered>
          <span slot="name" slot-scope="text">{{ text }}</span>
        </a-table>
      </a-row>
      <!-- <a-row v-else>
        //协议网关旧协议
        <a-form-model-item label="天线编号">
          <a-select v-model="form.antenna">
            <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
          </a-select>
        </a-form-model-item>
        <a-form-model-item label="馈电通道">
          <a-select v-model="form.thoroughfare">
            <a-select-option :value="i" v-for="i in 4" :key="`${i}thoroughfare`">{{ i }}</a-select-option>
          </a-select>
        </a-form-model-item>
        <a-form-model-item label="调制IP" prop="modulationIP">
          <a-input v-model="form.modulationIP" />
        </a-form-model-item>
        <a-form-model-item label="解调IP" prop="demodulationIP">
          <a-input v-model="form.demodulationIP" />
        </a-form-model-item>
      </a-row> -->
      <a-row v-else>
         <table class='matrixTable'>
           <thead>
            <tr>
              <th> </th>
              <th>通道1</th>
              <th>通道2</th>
              <th>通道3</th>
              <th>通道4</th>
              <!-- 更多表头 -->
            </tr>
          </thead>
          <tbody>
            <tr v-for="(row, rowIndex) in matrixData" :key="`row-${rowIndex}`">
              <td v-for="(cell, cellIndex) in row" :key="`cell-${rowIndex}-${cellIndex}`">
                <div v-if="cellIndex!=0">
                  <!-- <p>ip: <a-input v-model="cell.ip"></a-input></p> 
                  <p>ip1:{{ cell.ip1 }}</p>  -->
                    <a-form :form="cell" :label-col="{ span: 6 }" :wrapper-col="{ span: 18}" >
                      <a-form-item label="调制ip">
                        <a-input v-model="cell.ip"/>
                      </a-form-item>
                      <a-form-item label="解调ip">
                        <a-input v-model="cell.ip1"/>
                      </a-form-item>
                    </a-form>
                </div>
                <span v-else>{{cell}}</span>
              </td>
            </tr>
          </tbody>
    </table>

      </a-row>
      
      <a-form-model-item :wrapper-col="{ span: 12, offset: 20 }" v-if="!prohibit">
        <a-button type="primary" @click="onSubmitAllConfigMatrixData">全部配置</a-button>
      </a-form-model-item>
      <!-- <a-form-model-item :wrapper-col="{ span: 12, offset: 20 }" v-if="!prohibit">
        <a-button type="primary" @click="onSubmit1">全部配置</a-button>
        <a-button style="margin-left: 10px"> Cancel </a-button>
      </a-form-model-item> -->
    </a-form-model>
    <a-form-model
      :model="form1"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
      v-if="sctiveType == 'VBandUpconverter'"
    >
      <a-row v-if="prohibit">
        <div
          v-if="prohibit"
          :class="prohibit ? 'prohibit' : ''"
          style="width: 100%; display: flex; justify-content: space-around"
        >
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前上变频器温度">
                  <a-input v-model="form.workingDataV1" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前上变频器增益">
                  <a-table
                    rowKey="id"
                    :columns="workingDataV2Columns"
                    size="small"
                    :data-source="form.workingDataV2"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前上变频器本振偏移量">
                  <a-table
                    rowKey="id"
                    :columns="workingDataV3Columns"
                    size="small"
                    :data-source="form.workingDataV3"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前上变频器状态">
                  <a-table
                    rowKey="id"
                    :columns="workingDataV4Columns"
                    size="small"
                    :data-source="form.workingDataV4"
                    :pagination="false"
                       bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电压">
                  <a-input v-model="form.workingDataV5" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电流">
                  <a-input v-model="form.workingDataV6" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="通路开关状态">
                  <a-table
                    rowKey="id"
                    :columns="workingDataV7Columns"
                    size="small"
                    :data-source="form.workingDataV7"
                    :pagination="false"
                    bordered
                  >
                    <span slot="gain" slot-scope="text">{{ text == 1 ? '开' : '关' }}</span>
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="终端序列号">
                  <a-input v-model="form.workingDataV8" />
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
        </div>
      </a-row>
      <a-row v-else>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="设备开关">
              <a-switch checked-children="开" un-checked-children="关" default-checked v-model="form.parameter" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="增益设置">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.frequency1">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <!-- <a-input
                  suffix="dB"
                  v-model="form.frequency2"
                  @blur="(value) => (value ? (form.frequency2 = parseFloat(value).toFixed(2)) : undefined)"
                /> -->

                <a-input-number
                  v-model="form.frequency2"
                  :min="5.0"
                  :max="35.0"
                  :step="0.5"
                  :precision="2"
                  placeholder="请输入5-35dB"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}dB` : '')"
                  :parser="(value) => value.replace('dB', '').replace('d', '').replace('B', '')"
                  @change="(value) => (value ? (form.frequency2 = parseFloat(value).toFixed(2)) : '5.00')"
                />
              </div>
              <span>请输入5-35dB</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleFrequencyConfig(1)">设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="通道开关">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.frequency3">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3</a-select-option>
                </a-select>
                <a-select v-model="form.frequency4">
                  <a-select-option value="1"> 开 </a-select-option>
                  <a-select-option value="0"> 关 </a-select-option>
                </a-select>
              </div>
              <!-- <span>输入内容最长不超过5位</span> -->
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleFrequencyConfig(2)">设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item :label="`本振偏移量设置${Basicvalue}`">
              <div style="display: flex">
                <a-select
                  style="width: 120px"
                  v-model="form.frequency5"
                  @change="changeThoroughfare(form.frequency5, 1)"
                >
                  <a-select-option value="1"> 通道1</a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <!-- <a-input v-model="form.frequency6" /> -->

                <a-input-number
                  v-if="form.frequency5 && form.frequency5 == 1"
                  v-model="form.frequency6"
                  :min="45.85"
                  :max="46.75"
                  :step="0.05"
                  :precision="2"
                  placeholder="请输入45.85-46.75G"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}G` : '')"
                  :parser="(value) => value.replace('G', '')"
                  @change="(value) => (value ? (form.frequency6 = parseFloat(value).toFixed(2)) : '45.85')"
                />
                <a-input-number
                  v-if="form.frequency5 && form.frequency5 == 2"
                  v-model="form.frequency6"
                  :min="46.85"
                  :max="48.85"
                  :step="0.05"
                  :precision="2"
                  placeholder="请输入46.85-48.85G"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}G` : '')"
                  :parser="(value) => value.replace('G', '')"
                  @change="(value) => (value ? (form.frequency6 = parseFloat(value).toFixed(2)) : '46.85')"
                />
                <a-input-number
                  v-if="form.frequency5 && form.frequency5 == 3"
                  v-model="form.frequency6"
                  :min="47.188"
                  :max="48.187"
                  :step="0.005"
                  :precision="3"
                  placeholder="请输入47.188-48.187G"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}G` : '')"
                  :parser="(value) => value.replace('G', '')"
                  @change="(value) => (value ? (form.frequency6 = value.toFixed(3)) : '')"
                />
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleFrequencyConfig(3)">设置</a-button>
          </a-col>
        </a-row>

        <a-row>
          <a-col :span="20">
            <a-form-model-item label="清除告警">
              <a-button type="primary" style @click="handleFrequencyConfig(4)">清除告警</a-button>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <!-- <a-button type="primary" icon="setting" style>设置</a-button> -->
          </a-col>
        </a-row>
      </a-row>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 22 }" v-if="false">
        <a-button type="primary" @click="onSubmit">全部配置</a-button>
        <!-- <a-button style="margin-left: 10px"> Cancel </a-button> -->
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form"
      :label-col="labelCol"
      :rules="rules"
      :wrapper-col="wrapperCol"
      v-if="sctiveType == 'QBandDownconverter'"
    >
      <a-row v-if="prohibit">
        <div
          v-if="prohibit"
          :class="prohibit ? 'prohibit' : ''"
          style="width: 100%; display: flex; justify-content: space-around"
        >
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器温度">
                  <a-input v-model="form.workingDataQ1" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器增益">
                  <a-table
                    rowKey="id"
                    :columns="workingDataQ2Columns"
                    size="small"
                    :data-source="form.workingDataQ2"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器本振偏移量">
                  <a-table
                    rowKey="id"
                    :columns="workingDataQ3Columns"
                    size="small"
                    :data-source="form.workingDataQ3"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器状态">
                  <a-table
                    rowKey="id"
                    :columns="workingDataQ4Columns"
                    size="small"
                    :data-source="form.workingDataQ4"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电压">
                  <a-input v-model="form.workingDataQ5" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电流">
                  <a-input v-model="form.workingDataQ6" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="通路开关状态">
                  <a-table
                    rowKey="id"
                    :columns="workingDataQ7Columns"
                    size="small"
                    :data-source="form.workingDataQ7"
                    :pagination="false"
                    bordered
                  >
                    <span slot="gain" slot-scope="text">{{ text == 1 ? '开' : '关' }}</span>
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="输出功率">
                  <a-table
                    rowKey="id"
                    :columns="workingDataQ9Columns"
                    size="small"
                    :data-source="form.workingDataQ9"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="终端序列号">
                  <a-input v-model="form.workingDataQ8" />
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
        </div>
      </a-row>
      <a-row v-else>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="设备开关">
              <a-switch checked-children="开" un-checked-children="关" default-checked v-model="form.parameter" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="输出功率" prop="qFrequency2">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.qFrequency1">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <a-input-number
                  v-model="form.qFrequency2"
                  :min="-5"
                  :max="5"
                  :step="0.5"
                  :precision="1"
                  placeholder="请输入-5-5dB"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}dB` : '')"
                  :parser="(value) => value.replace('dB', '').replace('d', '').replace('B', '')"
                  @change="(value) => (value ? (form.qFrequency2 = parseFloat(value).toFixed(1)) : '1.0')"
                />
              </div>
              <span>请输入-5-5dB</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" @click="handleQFrequencyConfig(1)" style>设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="通道开关">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.frequency3">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <a-select v-model="form.frequency4">
                  <a-select-option value="1"> 开 </a-select-option>
                  <a-select-option value="0"> 关 </a-select-option>
                </a-select>
              </div>
              <!-- <span>输入内容最长不超过5位</span> -->
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleQFrequencyConfig(2)">设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="增益设置">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.qFrequency5">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <a-input-number
                  v-model="form.qFrequency6"
                  :min="0.0"
                  :max="20.0"
                  :step="0.05"
                  :precision="2"
                  placeholder="请输入0-20dB"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}dB` : '')"
                  :parser="(value) => value.replace('dB', '').replace('d', '').replace('B', '')"
                  @change="(value) => (value ? (form.qFrequency6 = parseFloat(value).toFixed(2)) : '1.00')"
                />
              </div>
              <span>请输入0-20dB</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleQFrequencyConfig(3)">设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item :label="`本振偏移量设置${Basicvalue}`">
              <div style="display: flex">
                <a-select
                  style="width: 120px"
                  v-model="form.qFrequency7"
                  @change="changeThoroughfare(form.qFrequency7, 2)"
                >
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <!-- <a-input v-model="form.qFrequency 8" /> -->
                <a-input-number
                  v-if="form.qFrequency7 && form.qFrequency7 == 1"
                  v-model="form.qFrequency8"
                  :min="-700"
                  :max="90"
                  :step="1"
                  :precision="1"
                  placeholder="请输入-700~90MHz"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}MHz` : '')"
                  :parser="
                    (value) =>
                      value
                        .replace('MHz', '')
                        .replace('MH', '')
                        .replace('Hz', '')
                        .replace('M', '')
                        .replace('z', '')
                        .replace('H', '')
                  "
                  @change="(value) => (value ? (form.qFrequency8 = parseFloat(value).toFixed(1)) : '1.0')"
                />
                <a-input-number
                  v-if="form.qFrequency7 && form.qFrequency7 == 2"
                  v-model="form.qFrequency8"
                  :min="-900"
                  :max="700"
                  :step="1"
                  :precision="1"
                  placeholder="请输入-900~700MHz"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}MHz` : '')"
                  :parser="
                    (value) =>
                      value
                        .replace('MHz', '')
                        .replace('MH', '')
                        .replace('Hz', '')
                        .replace('M', '')
                        .replace('z', '')
                        .replace('H', '')
                  "
                  @change="(value) => (value ? (form.qFrequency8 = parseFloat(value).toFixed(1)) : '1.0')"
                />
                <a-input-number
                  v-if="form.qFrequency7 && form.qFrequency7 == 3"
                  v-model="form.qFrequency8"
                  :min="-700"
                  :max="900"
                  :precision="1"
                  placeholder="请输入-700~900"
                  style="width: 100%"
                  :formatter="(value) => (value ? `${value}MHz` : '')"
                  :parser="
                    (value) =>
                      value
                        .replace('MHz', '')
                        .replace('MH', '')
                        .replace('Hz', '')
                        .replace('M', '')
                        .replace('z', '')
                        .replace('H', '')
                  "
                  @change="(value) => (value ? (form.qFrequency8 = parseFloat(value).toFixed(1)) : '1.0')"
                />
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" @click="handleQFrequencyConfig(4)" style>设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="清除告警">
              <a-button type="primary" style @click="handleQFrequencyConfig(5)">清除告警</a-button>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-row>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 22 }" v-if="false">
        <a-button type="primary" @click="onSubmit">全部配置</a-button>
        <!-- <a-button style="margin-left: 10px"> Cancel </a-button> -->
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form1"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
      v-if="sctiveType == 'singleChannelDownConverter'"
    >
      <a-row v-if="prohibit">
        <div
          v-if="prohibit"
          :class="prohibit ? 'prohibit' : ''"
          style="width: 100%; display: flex; justify-content: space-around"
        >
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器温度">
                  <a-input v-model="form.workingDataD1" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器增益">
                  <a-table
                    rowKey="id"
                    :columns="workingDataD2Columns"
                    size="small"
                    :data-source="form.workingDataD2"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器本振偏移量">
                  <a-table
                    rowKey="id"
                    :columns="workingDataD3Columns"
                    size="small"
                    :data-source="form.workingDataD3"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前下变频器状态">
                  <a-table
                    rowKey="id"
                    :columns="workingDataD4Columns"
                    size="small"
                    :data-source="form.workingDataD4"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
          <a-row style="width: 49%">
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电压">
                  <a-input v-model="form.workingDataD5" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="当前电流">
                  <a-input v-model="form.workingDataD6" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="输出功率">
                  <a-table
                    rowKey="id"
                    :columns="workingDataD9Columns"
                    size="small"
                    :data-source="form.workingDataD9"
                    :pagination="false"
                    bordered
                  >
                  </a-table>
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-model-item label="终端序列号">
                  <a-input v-model="form.workingDataD8" />
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-row>
        </div>
      </a-row>
      <a-row v-else>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="输出功率">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.single1">
                  <a-select-option value="1"> 1 </a-select-option>
                  <a-select-option value="2"> 2 </a-select-option>
                  <a-select-option value="3"> 3 </a-select-option>
                </a-select>
                <a-input v-model="form.single2" />
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" @click="handleSingleConfig(1)" style>设置</a-button>
          </a-col>
        </a-row>
        <!-- <a-row>
          <a-col :span="20">
            <a-form-model-item label="通道开关">
              <div style="display: flex;">
                <a-select style="width: 120px" v-model="form.frequency3">
                  <a-select-option value="1">
                    1
                  </a-select-option>
                  <a-select-option value="2">
                    2
                  </a-select-option>
                  <a-select-option value="3">
                    3
                  </a-select-option>
                </a-select>
                <a-select v-model="form.frequency4">
                  <a-select-option value="01">
                    开
                  </a-select-option>
                  <a-select-option value="00">
                    关
                  </a-select-option>
                </a-select>
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button
              type="primary"
              icon="setting"
              style
              @click="handleSingleConfig(2)">设置</a-button>
          </a-col>
        </a-row> -->
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="增益设置">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.single5">
                  <a-select-option value="1"> 通道1 </a-select-option>
                  <a-select-option value="2"> 通道2 </a-select-option>
                  <a-select-option value="3"> 通道3 </a-select-option>
                </a-select>
                <a-input v-model="form.single6" />
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style @click="handleSingleConfig(3)">设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="本振偏移量设置">
              <div style="display: flex">
                <a-select style="width: 120px" v-model="form.single7">
                  <a-select-option value="1"> 1 </a-select-option>
                  <a-select-option value="2"> 2 </a-select-option>
                  <a-select-option value="3"> 3 </a-select-option>
                </a-select>
                <a-input v-model="form.single8" />
              </div>
              <span>输入内容最长不超过5位</span>
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" @click="handleSingleConfig(4)" style>设置</a-button>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="20">
            <a-form-model-item label="清除告警">
              <a-button type="primary" style @click="handleSingleConfig(5)">清除告警</a-button>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-row>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 22 }" v-if="false">
        <a-button type="primary" @click="onSubmit">全部配置</a-button>
        <!-- <a-button style="margin-left: 10px"> Cancel </a-button> -->
      </a-form-model-item>
    </a-form-model>
    <a-form-model
      :model="form"
      :label-col="labelCol1"
      :wrapper-col="wrapperCol1"
      :rules="rules"
      v-if="sctiveType == 'MeasurementControlBaseband'"
    >
      <div v-if="!prohibit" style="width: 100%; display: flex; flex-wrap: wrap">
        <a-card title="公共单元参数" style="width: 50%">
            <a-button slot="extra" @click="handleGGDY">配置</a-button>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="任务标识">
                <a-input v-model="form.taskID" />
              </a-form-model-item>
            </a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(1)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="上行工作频率">
                <a-input v-model="form.UpWworkFrequency" />
              </a-form-model-item>
            </a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(2)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="下行工作频率"> <a-input v-model="form.DownWworkFrequency" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(3)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
        <a-card title="上行调制器参数" style="width: 50%">
          
            <a-button slot="extra" @click="handleSXTZQ">配置</a-button>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="载波输出控制"> <a-input v-model="form.OutputControl" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(4)" style>设置</a-button> -->
            </a-col>
          </a-row>

          <a-row>
            <a-col :span="20">
              <a-form-model-item label="载波输出电平">
                 <a-input-number style="width:100%"  :min=-60 :max=0 v-model="form.OutputLevel" />
                 </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(5)" style>设置</a-button> -->
            </a-col>
          </a-row>
          
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="扩频码速率"> <a-input placeholder='请输入16进制数，1~A' v-model="form.spreadCodeRate2" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(8)" style>设置</a-button> -->
            </a-col>
          </a-row>
            <a-row>
            <a-col :span="20">
              <a-form-model-item label="通道输出(测量)">
                <!-- <a-input v-model="form.ChannelOutputControl1" /> -->
                 <a-select v-model="form.ChannelOutputControl1" >
                      <a-select-option value="1">
                        允许
                      </a-select-option>
                      <a-select-option value="2">
                        禁止
                      </a-select-option>
                   </a-select>

                 </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(10)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20"
              ><a-form-model-item label="通道输出(遥控)">
                <!-- <a-input v-model="form.ChannelOutputControl" />  -->
                 <a-select v-model="form.ChannelOutputControl" >
                      <a-select-option value="1">
                        允许
                      </a-select-option>
                      <a-select-option value="2">
                        禁止
                      </a-select-option>
                   </a-select>
                </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(9)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
        <a-card title="遥控单元" style="width: 50%">
          
            <a-button slot="extra" @click="handleYK">配置</a-button>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码型">
                    <a-select v-model="form.RCpattern" >
                      <a-select-option value="01">
                        NRZ-L
                      </a-select-option>
                      <a-select-option value="02">
                        NRZ-M
                      </a-select-option>
                      <a-select-option value="03">
                        NRZ-S
                      </a-select-option>

                   </a-select>
              </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(11)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码速率类型">
                 <!-- <a-input v-model="form.RCcodRateType" /> -->
                  <a-select v-model="form.RCcodRateType" >
                      <a-select-option value="01">
                        卷积编码前
                      </a-select-option>
                      <a-select-option value="02">
                        卷积编码后
                      </a-select-option>

                   </a-select>
                 </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(12)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码速率"> <a-input v-model="form.RCcodeRate" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(13)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="遥控工作模式">
                <!-- <a-input v-model="form.RCremoteControlWorkMode" />  -->
                 <a-select v-model="form.RCremoteControlWorkMode" >
                      <a-select-option value="02">
                        突发
                      </a-select-option>
                      <a-select-option value="01">
                        常发
                      </a-select-option>

                   </a-select>
                </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(14)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
        <a-card title="遥测单元" style="width: 50%">
            <a-button slot="extra" @click="handleYC">配置</a-button>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码型">
                <!-- <a-input v-model="form.TMpattern" /> -->
                  <a-select v-model="form.TMpattern" >
                      <a-select-option value="01">
                        NRZ-L
                      </a-select-option>
                      <a-select-option value="02">
                        NRZ-M
                      </a-select-option>
                      <a-select-option value="03">
                        NRZ-S
                      </a-select-option>

                   </a-select>
               </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(15)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码速率设置方式">
                <!-- <a-input v-model="form.TMCodeRateSettingMethod" /> -->
                  <a-select v-model="form.TMCodeRateSettingMethod" >
                      <a-select-option value="01">
                        编码前
                      </a-select-option>
                      <a-select-option value="02">
                        编码后
                      </a-select-option>

                   </a-select>
               </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(16)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="码速率"> <a-input v-model="form.TMcodeRate" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(17)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="译码方式">
                <!-- <a-input v-model="form.TMdecodingMethod" /> -->
                 <a-select v-model="form.TMdecodingMethod" >
                      <a-select-option value="01">
                        关
                      </a-select-option>
                      <a-select-option value="02">
                        Viterbi 译码
                      </a-select-option>
                      <a-select-option value="03">
                        R-S 译码
                      </a-select-option>
                      <a-select-option value="04">
                        R-S 和 Viterbi 级联译码
                      </a-select-option>
                      <a-select-option value="05">
                       Turbo
                      </a-select-option>
                      <a-select-option value="06">
                       LDPC
                      </a-select-option>
                   </a-select>
                 </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(18)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="卷积码类型">
                <!-- <a-input v-model="form.TMConvolutionalCodeType" />  -->
                 <a-select v-model="form.TMConvolutionalCodeType" >
                      <a-select-option value="01">
                        7，1/2
                      </a-select-option>
                      <a-select-option value="02">
                        7，3/4
                      </a-select-option>
                      <a-select-option value="03">
                        7，2/3
                      </a-select-option>
                      <a-select-option value="04">
                       7，5/6
                      </a-select-option>
                      <a-select-option value="05">
                      7，7/8
                      </a-select-option>
                   </a-select>
              </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(19)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
        <a-card title="扩频码单元参数" style="width: 100%">
          
            <a-button slot="extra" @click="handleKPM">配置</a-button>
          <!-- <a-row>
            <a-col :span="20"></a-col>
            <a-col :span="4">
              <a-button type="primary" icon="setting" @click="handleSingleConfig(1)" style>设置</a-button>
            </a-col>
          </a-row> -->
          <a-row>
            <a-col :span="10">
              <a-form-model-item label="上行遥控伪码初相1">
                <a-input v-model="form.upRCpseudocode1" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(20)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="上行遥控伪码初相2">
                <a-input v-model="form.upRCpseudocode2" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(21)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="上行测量伪码初相1">
                <a-input v-model="form.upMeasurementPseudocode1" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(22)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="上行测量伪码初相2">
                <a-input v-model="form.upMeasurementPseudocode2" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(23)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="下行遥测伪码初相1">
                <a-input v-model="form.downTMpseudocode1" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(24)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="下行遥测伪码初相2">
                <a-input v-model="form.downTMpseudocode2" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(25)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="下行测量伪码初相1">
                <a-input v-model="form.downMeasurementPseudocode1" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(26)" style>设置</a-button> -->
            </a-col>
            <a-col :span="10">
              <a-form-model-item label="下行测量伪码初相2">
                <a-input v-model="form.downMeasurementPseudocode2" /> </a-form-model-item
            ></a-col>
            <a-col :span="2">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(27)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
        
        <a-card title="中频接收机单元" style="width: 50%">
          
            <a-button slot="extra" @click="handleZPJS">配置</a-button>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="扩频码速率(遥测)"> <a-input v-model="form.spreadCodeRate" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(6)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="扩频码速率(测量)"> <a-input v-model="form.spreadCodeRate1" /> </a-form-model-item
            ></a-col>
            <a-col :span="4">
              <!-- <a-button type="primary" icon="setting" @click="handleMeasureConfig(7)" style>设置</a-button> -->
            </a-col>
          </a-row>
        </a-card>
      </div>
      <div v-if="prohibit" style="width: 100%; display: flex; flex-wrap: wrap">
        <a-card title="公共单元参数" style="width: 50%">
          <a-form-model-item label="主备切换状态">
            <a-input v-model="form.MainBackupSwitching" />
          </a-form-model-item>
          <a-form-model-item label="监控方式">
            <a-input v-model="form.monitorMode" />
            <!-- <a-select v-model="form.antenna">
            <a-select-option :value="i" v-for="i in 8" :key="`${i}ant`">{{ i }}</a-select-option>
          </a-select> -->
          </a-form-model-item>
          <a-form-model-item label="本机在线状态">
            <a-input v-model="form.LocalOnlineStatus" />
          </a-form-model-item>
          <a-form-model-item label="外时码状态">
            <a-input v-model="form.ExternalTimeCodeStatus" />
          </a-form-model-item>
          <a-form-model-item label="外频标状态">
            <a-input v-model="form.ExternalFrequencyStandard" />
          </a-form-model-item>
          <a-form-model-item label="基带送数方式">
            <a-input v-model="form.BasebandTransmissionMethod" />
          </a-form-model-item>
        </a-card>
        <a-card title="目标部分参数" style="width: 50%">
          <a-form-model-item label="接收中心指令包数">
            <a-input v-model="form.ReceiveCentralInstPacketsNum" />
          </a-form-model-item>
          <a-form-model-item label="遥控发令条数">
            <a-input v-model="form.RCcommandsNum" />
          </a-form-model-item>
          <a-form-model-item label="遥控小环误指令条">
            <a-input v-model="form.RCsLoopErrorCommandNum" />
          </a-form-model-item>
          <a-form-model-item label="遥控小环环回中心条数">
            <a-input v-model="form.RCsLoopCentersNum" />
          </a-form-model-item>
        </a-card>
        <a-card title="中频接收机单元遥测参数" style="width: 50%">
          <a-form-model-item label="遥测载波锁定">
            <a-input v-model="form.TeleCarrierLocking" />
          </a-form-model-item>
          <a-form-model-item label="遥测伪码锁定">
            <a-input v-model="form.TelePseudocodeLocking" />
          </a-form-model-item>
          <a-form-model-item label="遥测 AGC 电压">
            <a-input v-model="form.TeleAGCVoltage" />
          </a-form-model-item>
        </a-card>
        <a-card title="中频接收机单元测量参数" style="width: 50%">
          <a-form-model-item label="星锁指示">
            <a-input v-model="form.StarlockIndication" />
          </a-form-model-item>
          <a-form-model-item label="测量载波锁定指示">
            <a-input v-model="form.MeasurementCarrierLockIndication" />
          </a-form-model-item>
          <a-form-model-item label="测量伪码锁定指示">
            <a-input v-model="form.MeasurementPseudocodeLockIndication" />
          </a-form-model-item>
          <a-form-model-item label="测量 AGC 电压">
            <a-input v-model="form.MeasurementAGCVoltage" />
          </a-form-model-item>
          <a-form-model-item label="测量 C/N0">
            <a-input v-model="form.MeasureCN0" />
          </a-form-model-item>
        </a-card>

        <a-card title="遥控单元参数" style="width: 50%">
          <a-form-model-item label="小环接收机锁定指示">
            <a-input v-model="form.sloopReceiverLockIndication" />
          </a-form-model-item>
          <a-form-model-item label="小环比对结果">
            <a-input v-model="form.ComparisonResultsOfsLoop" />
          </a-form-model-item>
        </a-card>
      </div>
    </a-form-model>
    <a-form-model :model="form1" :label-col="labelCol" :wrapper-col="wrapperCol" v-if="sctiveType == 'switchMatrix'">
      <a-row>
        <!-- <a-row>
          <a-col :span="20">
            <a-form-model-item label="本远控制方式">
              <j-dict-select-tag
                v-model="form.mode"
                placeholder="请选择本远控制方式"
                :type="'radio'"
                dictCode="local_remote_control_mode"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style>设置</a-button>
          </a-col>
        </a-row> -->
        <a-row v-if="prohibit">
          <a-col :span="24" style="display: flex">
            <a-table :columns="columns" rowKey="id" size="small" :data-source="data" :pagination="false" bordered>
              <span slot="name" slot-scope="text">{{ text }}</span>
            </a-table>
          </a-col>
        </a-row>
        <a-row v-else>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="输入通道">
                <a-select v-model="form.switchMatrix1" style="width: 160px">
                  <a-select-option :value="index" v-for="(i, index) in 16" :key="`${i}outputChannel`">{{
                    i
                  }}</a-select-option>
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="4" v-if="!prohibit">
              <!-- <a-button type="primary" icon="setting" @click="conditionSwitchMatrixFilter(1)" style>设置</a-button> -->
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="输出通道">
                <a-select v-model="form.switchMatrix2" style="width: 160px">
                  <a-select-option :value="i" v-for="(i, index) in 16" :key="`${i}outputChannel`">{{
                    i
                  }}</a-select-option>
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="4" v-if="!prohibit">
              <a-button type="primary" icon="setting" @click="conditionSwitchMatrixFilter(2)" style>设置</a-button>
            </a-col>
          </a-row>
        </a-row>
        <!-- <a-row>
          <a-col :span="20"> </a-col>
          <a-col :span="4" v-if="!prohibit">
            <a-button
              type="primary"
              icon="setting"
              style
              @click="handleConfig('1-启动开关')"
              >设置</a-button
            >
          </a-col>
        </a-row> -->
        <a-row v-if="!prohibit">
          <a-row>
            <a-col :span="20">
              <a-form-model-item label="清除告警">
                <a-button type="primary" @click="conditionSwitchMatrixFilter(3)" style>清除告警</a-button>
              </a-form-model-item>
            </a-col>
            <!-- <a-col :span="4" v-if="!prohibit">
            <a-button type="primary" icon="setting" style>清空</a-button>
          </a-col> -->
          </a-row>
        </a-row>
      </a-row>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 22 }" v-if="false">
        <a-button type="primary" @click="onSubmit">全部配置</a-button>
        <!-- <a-button style="margin-left: 10px"> Cancel </a-button> -->
      </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import { getAction, postAction, putAction, httpAction } from '@api/manage'
import analysisWorkData from './analysisWorkData'
import {IPV4} from '@/utils/rules.js'
const columns = [
  {
    title: '输出通道',
    dataIndex: 'enter',
    key: 'enter',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '输入通道',
    dataIndex: 'outputState',
    key: 'outputState',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '通道功率',
    dataIndex: 'power',
    key: 'power',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '饱和状态',
    dataIndex: 'saturateState',
    key: 'saturateState',
    ellipsis: true,
    align: 'center',
  },
]

const data = []
const columns1 = [
  {
    title: '天线编号',
    dataIndex: 'antenna',
    key: 'antenna',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '馈电通道',
    dataIndex: 'passage',
    key: 'passage',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '调制IP地址',
    dataIndex: 'modulationIp',
    key: 'modulationIp',
    ellipsis: true,
    align: 'center',
  },
  {
    title: '解调IP地址',
    dataIndex: 'demodulationIp',
    key: 'demodulationIp',
    ellipsis: true,
    align: 'center',
  },
]

const data1 = []
export default {
  mixins: [analysisWorkData],
  props: {
    sctiveType: {
      type: String,
      default: '',
    },
    nodeData: {
      type: Object,
      default: {},
    },
    prohibit: {
      type: Boolean,
      default: false,
    },
    deviceData: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    const IPValidator = (rule, value, callback) => {
      if (
        !/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
          value
        )
      ) {
        callback('请输入有效的IPv4地址')
      } else {
        callback()
      }
    }
    const MaskValidator = (rule, value, callback) => {
      if (
        !/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
          value
        )
      ) {
        callback('请输入有效的掩码地址')
      } else {
        callback()
      }
    }
    const demodulationIPValidator = (rule, value, callback) => {
      if (
        !/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
          value
        )
      ) {
        callback('请输入有效的ip地址')
      } else {
        callback()
      }
    }
    const modulationIPValidator = (rule, value, callback) => {
      // console.log(value)
      if (
        !/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
          value
        )
      ) {
        callback('请输入有效的ip地址')
      } else {
        callback()
      }
    }
    const qFrequency2PValidator = (rule, value, callback) => {
      // console.log(value)
      if ((value * 2).toFixed(2) / 2) {
        this.form.frequency2 = (value * 2).toFixed(2) / 2
        callback()
      } else {
        callback()
      }
    }
    return {
      rules: {
        parameter15: [{ validator: IPValidator, trigger: 'change' }],
        parameter17: [{ validator: MaskValidator, trigger: 'change' }],
        modulationIP: [{ validator: modulationIPValidator, trigger: 'change' }],
        demodulationIP: [{ validator: demodulationIPValidator, trigger: 'change' }],
        qFrequency2: [{ validator: qFrequency2PValidator, trigger: 'blur' }],
      },
      rules1: {},
      data,
      columns,
      data1,
      columns1,
      labelCol: { span: 14 },
      wrapperCol: { span: 10 },
      labelCol1: { span: 10},
      wrapperCol1: { span: 12 },
      Basicvalue: '',
      form: {
        JDNo:2,
        modulationIP: '',
        antenna: '',
        thoroughfare: '',
        demodulationIP: '',
        parameter1: '',
        parameter2: '',
        parameter3: '',
        parameter4: '',
        parameter5: '',
        parameter6: '',
        parameter7: '',
        parameter8: '',
        parameter9: '',
        parameter10: '',
        parameter11: '',
        parameter12: '',
        parameter13: '',
        parameter14: '',
        parameter15: '',
        parameter16: '',
        parameter17: '',
        parameter18: '',
        parameter19: '',
        frequency1: '',
        frequency2: '',
        frequency3: '',
        frequency4: '',
        frequency5: '',
        frequency6: '',
        switchMatrix1: '',
        switchMatrix2: '',
        qFequency1: '',
        qFequency2: '',
        qFequency3: '',
        qFequency4: '',
        qFequency5: '',
        qFequency6: '',
        qFequency7: '',
        qFequency8: '',

        single1: '',
        single2: '',
        single3: '',
        single4: '',
        single5: '',
        single6: '',
        single7: '',
        single8: '',
        workingData1: '',
        workingData2: '',
        workingData3: '',
        workingData4: '',
        workingData5: '',
        workingData6: '',
        workingData7: '',
        workingData8: '',
        workingData9: '',
        workingData10: '',
        workingData11: '',
        workingData12: '',
        workingData13: '',
        workingData14: '',
        workingData15: '',
        workingDataV1: '',
        workingDataV2: [],
        workingDataV3: [],
        workingDataV4: [],
        workingDataV5: '',
        workingDataV6: '',
        workingDataV7: [],
        workingDataV8: '',
        workingDataQ1: '',
        workingDataQ2: [],
        workingDataQ3: [],
        workingDataQ4: [],
        workingDataQ5: '',
        workingDataQ6: '',
        workingDataQ7: [],
        workingDataQ8: '',
        workingDataQ9: [],
        workingDataD1: '',
        workingDataD2: [],
        workingDataD3: [],
        workingDataD4: [],
        workingDataD5: '',
        workingDataD6: '',
        workingDataD7: '',
        workingDataD8: '',
        workingDataD9: [],
        frequency1: '1',
        frequency2: 0,
        frequency3: '1',
        qFrequency1: '1',
        qFrequency2: 0,
        qFrequency6: 0,
        qFrequency5: '1',
        qFrequency7: '1',
        single5: 0,
        taskID:'',
        UpWworkFrequency:"",
        DownWworkFrequency:"",
        OutputControl:"",
        OutputLevel:'',
        spreadCodeRate:"",
        spreadCodeRate1:'',
        spreadCodeRate2:"",
        ChannelOutputControl:"",
        ChannelOutputControl1:"",
        RCpattern:"",
        RCcodRateType:"",
        RCcodeRate:'',
        RCremoteControlWorkMode:"",
        TMpattern:"",
        TMCodeRateSettingMethod:"",
        TMcodeRate:"",
        TMdecodingMethod:"",
        TMConvolutionalCodeType:"",
        upRCpseudocode1:"",
        upRCpseudocode2:"",
        upMeasurementPseudocode1:"",
        upMeasurementPseudocode2:"",
        downTMpseudocode1:"",
        downTMpseudocode2:"",
        downMeasurementPseudocode1:"",
        downMeasurementPseudocode2:""
      },
      form1: {},
      activeKey: ['1'],
      outputChannelList: [],
      inputChannelList: [],
      timer: null,
      matrixData: [
        ['天线1',{ip:'192.168.111.111',ip1:'192.168.111.112'}, {ip:'192.168.111.113',ip1:'192.168.111.114'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线2',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线3',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.1.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线4',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线5',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线6',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.1.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线7',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
        ['天线8',{ip:'192.168.111.102',ip1:'192.168.111.102'}, {ip:'192.168.1.102',ip1:'192.168.111.102'}, {ip:'192.168.111.102',ip1:'192.168.111.102'},{ip:'192.168.111.102',ip1:'192.168.111.102'}],
      ]
    }
  },
  created() {
  
    // 工作参数
    if (this.prohibit) {
      this.timer = setInterval(() => {
        this.getWorkingData()
      }, 1000)
    } else {
      this.getRequestsAll(this.sctiveType)
    }
  },
  mounted() {
    console.log(this.sctiveType)
  },
  beforeDestroy() {
    clearInterval(this.timer)
  },
  methods: {  
    handleYK(){
      
      let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '867-测控-遥控单元-遥控工作模式',
                  packageGridValue: this.form.RCremoteControlWorkMode,
                  basePackageGridValue:this.form.RCremoteControlWorkMode,
                },
                 {
                  gridCode: '867-测控-遥控单元-码速率',
                  packageGridValue:this.form.RCcodeRate,
                  basePackageGridValue:this.form.RCcodeRate,
                },
                 {
                  gridCode: '867-测控-遥控单元-码速率类型',
                  packageGridValue: this.form.RCcodRateType,
                  basePackageGridValue:this.form.RCcodRateType,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '867-测控-遥控单元-码型',
                  packageGridValue: this.form.RCpattern,
                  basePackageGridValue:this.form.RCpattern,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '867-测控基带-遥控单元参数配置',
            }
            this.sendPackageMethod(data)
    },
    handleKPM(){
      
      let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '869-测控-扩频码单元-上行遥控伪码初相1',
                  packageGridValue: this.form.upRCpseudocode1,
                  basePackageGridValue:this.form.upRCpseudocode1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-上行遥控伪码初相2',
                  packageGridValue:this.form.upRCpseudocode2,
                  basePackageGridValue:this.form.upRCpseudocode2,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-上行测量伪码初相1',
                  packageGridValue:this.form.upMeasurementPseudocode1,
                  basePackageGridValue:this.form.upMeasurementPseudocode1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-上行测量伪码初相2',
                  packageGridValue:this.form.upMeasurementPseudocode2,
                  basePackageGridValue:this.form.upMeasurementPseudocode2,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-下行遥测伪码初相1',
                  packageGridValue:this.form.downTMpseudocode1,
                  basePackageGridValue:this.form.downTMpseudocode1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-下行遥测伪码初相2',
                  packageGridValue:this.form.downTMpseudocode2,
                  basePackageGridValue:this.form.downTMpseudocode2,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-下行测量伪码初相1',
                  packageGridValue:this.form.downMeasurementPseudocode1,
                  basePackageGridValue:this.form.downMeasurementPseudocode1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '869-测控-扩频码单元-下行测量伪码初相2',
                  packageGridValue:this.form.downMeasurementPseudocode2,
                  basePackageGridValue:this.form.downMeasurementPseudocode2,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '869-测控基带-扩频码单元参数配置',
            }
            this.sendPackageMethod(data)
    },
    handleZPJS(){
      let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '865-测控-中频接收单元-测量扩频码速率',
                  packageGridValue: this.form.spreadCodeRate1,
                  basePackageGridValue:this.form.spreadCodeRate1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '865-测控-中频接收单元-遥测扩频码速率',
                  packageGridValue:this.form.spreadCodeRate,
                  basePackageGridValue:this.form.spreadCodeRate,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '865-测控基带-中频接收单元参数配置',
            }
            this.sendPackageMethod(data)
      
    },
    handleYC(){
      
      let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '868-测控-遥测单元-卷积码类型',
                  packageGridValue: this.form.TMConvolutionalCodeType,
                  basePackageGridValue:this.form.TMConvolutionalCodeType,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '868-测控-遥测单元-译码方式',
                  packageGridValue:this.form.TMdecodingMethod,
                  basePackageGridValue:this.form.TMdecodingMethod,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '868-测控-遥测单元-码速率',
                  packageGridValue: this.form.TMcodeRate,
                  basePackageGridValue:this.form.TMcodeRate,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '868-测控-遥测单元-码速率设置方式',
                  packageGridValue: this.form.TMCodeRateSettingMethod,
                  basePackageGridValue:this.form.TMCodeRateSettingMethod,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '868-测控-遥测单元-码型',
                  packageGridValue: this.form.TMpattern,
                  basePackageGridValue:this.form.TMpattern,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '868-测控基带-遥测单元参数配置',
            }
            this.sendPackageMethod(data)
    },
    handleSXTZQ(){
      let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '866-测控-上行调制单元-扩频码速率',
                  packageGridValue: this.form.spreadCodeRate2,
                  basePackageGridValue:this.form.spreadCodeRate2,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '866-测控-上行调制单元-遥控通道输出控制',
                  packageGridValue:this.form.ChannelOutputControl,
                  basePackageGridValue:this.form.ChannelOutputControl,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '866-测控-上行调制单元-测量通道输出控制',
                  packageGridValue: this.form.ChannelOutputControl1,
                  basePackageGridValue:this.form.ChannelOutputControl1,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '866-测控-上行调制单元-载波输出控制',
                  packageGridValue: this.form.OutputControl,
                  basePackageGridValue:this.form.OutputControl,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '866-测控-上行调制单元-载波输出电平',
                  packageGridValue: this.form.OutputLevel,
                  basePackageGridValue:this.form.OutputLevel,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '866-测控基带-上行调制单元参数配置',
            }
            this.sendPackageMethod(data)
    },
    handleGGDY() {
       let data={
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '864-测控-公共-任务标识',
                  packageGridValue: this.form.taskID,
                  basePackageGridValue:this.form.taskID,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '864-测控-公共-上行工作频率',
                  packageGridValue:this.form.UpWworkFrequency,
                  basePackageGridValue:this.form.UpWworkFrequency,
                  // basePackageGridValue: [],
                },
                 {
                  gridCode: '864-测控-公共-下行工作频率',
                  packageGridValue: this.form.DownWworkFrequency,
                  basePackageGridValue:this.form.DownWworkFrequency,
                  // basePackageGridValue: [],
                },
              ],
              packageCode: '864-测控基带-公共单元参数配置',
            }
            this.sendPackageMethod(data)
    
    },
    sendPackageMethod(data){
        httpAction('/device/dmDevice/sendPackage', data, 'post')
              .then(async (res) => {
                if (res.success) {
                  this.$message.success(`发包成功！`)
                  // this.getLatestPackageGridValue(tempData, val)
                } else {
                  this.$message.error(res.message)
                }
              })
              .finally(() => {})
    },
    onSubmitAllConfigMatrixData(){
        const tempData = {
          deviceId: this.deviceData.deviceId,
          nmcPackageGridValues: [
            // {
            //   gridCode: '101-协议网关-调制IP',
            //   packageGridValue: str1,
            //   basePackageGridValue: [this.form.modulationIP].join('￥'),
            // },
          ],
          packageCode: '860-协议网关-单元参数设置命令',
        }
        let flagIp=true
        let flagIp1=true
      this.matrixData.forEach((item,index)=>{
        item.forEach((i,idx)=>{
          if(typeof(i)=='object'){
            if(!IPV4(i.ip1)){
              this.$message.error(`${item[0]}通道${idx}解调IP地址格式错误`)
              flagIp1=false
              return 
            }
            if(!IPV4(i.ip)){
              this.$message.error(`${item[0]}通道${idx}调制IP地址格式错误`)
              flagIp=false
              return 
            }
              // 解制IP转16进制
        let aa = i.ip1.split('.')
        let str1 = ''
        aa.forEach((el) => {
          str1 += Number(el).toString(16).toUpperCase().padStart(2, 0)
        })
              // 调制IP转16进制
        let bb = i.ip.split('.')
        let str = ''
        bb.forEach((el) => {
          str += Number(el).toString(16).toUpperCase().padStart(2, 0)
        })
          let temp={
                    gridCode:`860-协议网关-单元参数-${item[0]}通道${idx}解制IP地址`,
                    packageGridValue:str1,
                    basePackageGridValue:[i.ip1].join('￥'),
                  }
                  let temp1={
                    gridCode:`860-协议网关-单元参数-${item[0]}通道${idx}调制IP地址`,
                    packageGridValue:str,
                    basePackageGridValue:[i.ip].join('￥'),

                  }
                    tempData.nmcPackageGridValues.push(temp)
                    tempData.nmcPackageGridValues.push(temp1)
                  
                    }
         })
        
      })
      console.log(tempData,'发包信息');
          if(!flagIp1){
              return 
            }
            if(!flagIp){
              return 
            }
        httpAction('/device/dmDevice/sendPackage', tempData, 'post')
          .then((res) => {
            if (res.success) {
              this.$message.success(`发包成功！`)
              // this.getConfig()
              //获取最新配置的协议网管配置信息
            }
          })
          .finally(() => {})
    },
    conditionMeasureFilter(val,tempData){
      //公共单元参数-任务标识
      if(val==1){
         tempData.nmcPackageGridValues = [
            {
              gridCode: '864-测控-公共-任务标识',
              packageGridValue: this.form.taskID,
              basePackageGridValue: this.form.taskID,
            },
          ]
          tempData.packageCode = '864-测控基带-公共单元参数配置'

        return
      } if(val==2){
        //公共单元参数-上行工作频率
        tempData.nmcPackageGridValues = [
            {
              gridCode: '864-测控-公共-上行工作频率',
              packageGridValue: this.form.UpWworkFrequency.toString(16).toUpperCase(),
              basePackageGridValue: this.form.UpWworkFrequency.toString(16).toUpperCase(),
            },
          ]
          tempData.packageCode = '864-测控基带-公共单元参数配置'
        return
      }if(val==3){
        //公共单元参数-下行工作频率
         tempData.nmcPackageGridValues = [
            {
              gridCode: '864-测控-公共-下行工作频率',
              packageGridValue: this.form.DownWworkFrequency.toString(16).toUpperCase(),
              basePackageGridValue: this.form.DownWworkFrequency.toString(16).toUpperCase(),
            },
          ]
          tempData.packageCode = '864-测控基带-公共单元参数配置'
       return
      }if(val==4){
        //上行调制器参数-载波输出控制
        tempData.nmcPackageGridValues = [
            {
              gridCode: '866-测控-上行调制单元-载波输出控制',
              packageGridValue: this.form.OutputControl,
              basePackageGridValue: this.form.OutputControl,
            },
          ]
          tempData.packageCode = '866-测控基带-上行调制单元参数配置'
         return
      }if(val==5){
        //上行调制器参数-载波输出电平
         tempData.nmcPackageGridValues = [
            {
              gridCode: '866-测控-上行调制单元-载波输出电平',
              packageGridValue: this.form.OutputLevel,
              basePackageGridValue: this.form.OutputLevel,
            },
          ]
          tempData.packageCode = '866-测控基带-上行调制单元参数配置'
         return
      }if(val==6){
        //中频接收机单元遥测参数-扩频码速率
        tempData.nmcPackageGridValues = [
            {
              gridCode: '865-测控-中频接收单元-遥测扩频码速率',
              packageGridValue: this.form.spreadCodeRate,
              basePackageGridValue: this.form.spreadCodeRate,
            },
          ]
          tempData.packageCode = '865-测控基带-中频接收单元参数配置'
       return
      }if(val==7){
        //中频接收机单元测量参数-扩频码速率
         tempData.nmcPackageGridValues = [
            {
              gridCode: '865-测控-中频接收单元-测量扩频码速率',
              packageGridValue: this.form.spreadCodeRate1,
              basePackageGridValue: this.form.spreadCodeRate1,
            },
          ]
          tempData.packageCode = '865-测控基带-中频接收单元参数配置'
        return
      }if(val==8){
        //上行调制器参数（遥控）-扩频码速率
       tempData.nmcPackageGridValues = [
            {
              gridCode: '866-测控-上行调制单元-扩频码速率',
              packageGridValue: this.form.spreadCodeRate2,
              basePackageGridValue: this.form.spreadCodeRate2,
            },
          ]
          tempData.packageCode = '866-测控基带-上行调制单元参数配置'
         return
      }if(val==9){
        //上行调制器参数（遥控）-通道输出控制
       tempData.nmcPackageGridValues = [
            {
              gridCode: '866-测控-上行调制单元-遥控通道输出控制',
              packageGridValue: this.form.ChannelOutputControl,
              basePackageGridValue: this.form.ChannelOutputControl,
            },
          ]
          tempData.packageCode = '866-测控基带-上行调制单元参数配置'
       return
      }if(val==10){
        //上行调制器参数（测量）-通道输出控制
         tempData.nmcPackageGridValues = [
            {
              gridCode: '866-测控-上行调制单元-测量通道输出控制',
              packageGridValue: this.form.ChannelOutputControl1,
              basePackageGridValue: this.form.ChannelOutputControl1,
            },
          ]
          tempData.packageCode = '866-测控基带-上行调制单元参数配置'
         return
      }if(val==11){
        //遥控单元-码型
         tempData.nmcPackageGridValues = [
            {
              gridCode: '867-测控-遥控单元-码型',
              packageGridValue: this.form.RCpattern,
              basePackageGridValue: this.form.RCpattern,
            },
          ]
          tempData.packageCode = '867-测控基带-遥控单元参数配置'
       return
      }if(val==12){
        //遥控单元-码速率类型
        tempData.nmcPackageGridValues = [
            {
              gridCode: '867-测控-遥控单元-码速率类型',
              packageGridValue: this.form.RCcodRateType,
              basePackageGridValue: this.form.RCcodRateType,
            },
          ]
          tempData.packageCode = '867-测控基带-遥控单元参数配置'
       return
      }if(val==13){
        //遥控单元-码速率
        tempData.nmcPackageGridValues = [
            {
              gridCode: '867-测控-遥控单元-码速率',
              packageGridValue: this.form.RCcodeRate,
              basePackageGridValue: this.form.RCcodeRate,
            },
          ]
          tempData.packageCode = '867-测控基带-遥控单元参数配置'
          return
      }if(val==14){
        //遥控单元-遥控工作模式
       tempData.nmcPackageGridValues = [
            {
              gridCode: '867-测控-遥控单元-遥控工作模式',
              packageGridValue: this.form.RCremoteControlWorkMode,
              basePackageGridValue: this.form.RCremoteControlWorkMode,
            },
          ]
          tempData.packageCode = '867-测控基带-遥控单元参数配置'
        return
      }if(val==15){
        //遥测单元-码型
        tempData.nmcPackageGridValues = [
            {
              gridCode: '868-测控-遥测单元-码型',
              packageGridValue: this.form.TMpattern,
              basePackageGridValue: this.form.TMpattern,
            },
          ]
          tempData.packageCode = '868-测控基带-遥测单元参数配置'
        return
      }if(val==16){
        //遥测单元-码速率设置方式
        tempData.nmcPackageGridValues = [
            {
              gridCode: '868-测控-遥测单元-码速率设置方式',
              packageGridValue: this.form.TMCodeRateSettingMethod,
              basePackageGridValue: this.form.TMCodeRateSettingMethod,
            },
          ]
          tempData.packageCode = '868-测控基带-遥测单元参数配置'
        return
      }if(val==17){
        //遥测单元-码速率
        tempData.nmcPackageGridValues = [
            {
              gridCode: '868-测控-遥测单元-码速率',
              packageGridValue: this.form.TMcodeRate,
              basePackageGridValue: this.form.TMcodeRate,
            },
          ]
          tempData.packageCode = '868-测控基带-遥测单元参数配置'
         return
      }if(val==18){
        //遥测单元-译码方式
        tempData.nmcPackageGridValues = [
            {
              gridCode: '868-测控-遥测单元-译码方式',
              packageGridValue: this.form.TMdecodingMethod,
              basePackageGridValue: this.form.TMdecodingMethod,
            },
          ]
          tempData.packageCode = '868-测控基带-遥测单元参数配置'
        return
      }if(val==19){
        //遥测单元-卷积码类型
        tempData.nmcPackageGridValues = [
            {
              gridCode: '868-测控-遥测单元-卷积码类型',
              packageGridValue: this.form.TMConvolutionalCodeType,
              basePackageGridValue: this.form.TMConvolutionalCodeType,
            },
          ]
          tempData.packageCode = '868-测控基带-遥测单元参数配置'
        return
      }if(val==20){
        //扩频码单元参数-上行遥控伪码初相1
       tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-上行遥控伪码初相1',
              packageGridValue: this.form.upRCpseudocode1,
              basePackageGridValue: this.form.upRCpseudocode1,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
       return
      }if(val==21){
        //扩频码单元参数-上行遥控伪码初相2
        tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-上行遥控伪码初相2',
              packageGridValue: this.form.upRCpseudocode2,
              basePackageGridValue: this.form.upRCpseudocode2,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
         return
      }if(val==22){
        //扩频码单元参数-上行测量伪码初相1
         tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-上行测量伪码初相1',
              packageGridValue: this.form.upMeasurementPseudocode1,
              basePackageGridValue: this.form.upMeasurementPseudocode1,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
       return
      }if(val==23){
        //扩频码单元参数-上行测量伪码初相2
        tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-上行测量伪码初相2',
              packageGridValue: this.form.upMeasurementPseudocode2,
              basePackageGridValue: this.form.upMeasurementPseudocode2,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
         return
      }if(val==24){
        //扩频码单元参数-下行遥测伪码初相1
       tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-下行遥测伪码初相1',
              packageGridValue: this.form.downTMpseudocode1,
              basePackageGridValue: this.form.downTMpseudocode1,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
        return
      }if(val==25){
        //扩频码单元参数-下行遥测伪码初相2
         tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-下行遥测伪码初相2',
              packageGridValue: this.form.downTMpseudocode2,
              basePackageGridValue: this.form.downTMpseudocode2,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
      return
      }if(val==26){
        console.log('-------***********第267ges')
        //扩频码单元参数-下行测量伪码初相1
       tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-下行测量伪码初相1',
              packageGridValue: this.form.downMeasurementPseudocode1,
              basePackageGridValue: this.form.downMeasurementPseudocode1,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
       return
      }if(val==27){
        console.log('第27ges')
        //扩频码单元参数-下行测量伪码初相2
        tempData.nmcPackageGridValues = [
            {
              gridCode: '869-测控-扩频码单元-下行测量伪码初相2',
              packageGridValue: this.form.downMeasurementPseudocode2,
              basePackageGridValue: this.form.downMeasurementPseudocode2,
            },
          ]
          tempData.packageCode = '869-测控基带-扩频码单元参数配置'
         return
      }
    },
    handleMeasureConfig(val){
      let tempData = {
              deviceId: this.deviceData.deviceId,
              nmcPackageGridValues: [
                {
                  gridCode: '',
                  packageGridValue: '',
                  basePackageGridValue: [],
                },
              ],
              packageCode: '',
            }
      this.conditionMeasureFilter(val, tempData)
      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    handleMeasureConfig2(card, type) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      //公共单元参数
      if (card == 1) {
        //公共单元参数-任务标识
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '801-测控基带-任务标识-参数值',
              packageGridValue: this.form.taskID,
              basePackageGridValue: this.form.taskID,
            },
          ]
          tempData.packageCode = '801-测控基带-公共单元-任务标识'
        }
        //公共单元参数-上行工作频率
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '802-测控基带-上行工作频率-参数值',
              packageGridValue: this.form.UpWworkFrequency.toString(16).toUpperCase(),
              basePackageGridValue: this.form.UpWworkFrequency.toString(16).toUpperCase(),
            },
          ]
          tempData.packageCode = '802-测控基带-公共单元-上行工作频率'
        }
        //公共单元参数-下行工作频率
        if (type == 'c') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '803-测控基带-下行工作频率-参数值',
              packageGridValue: this.form.DownWworkFrequency.toString(16).toUpperCase(),
              basePackageGridValue: this.form.DownWworkFrequency.toString(16).toUpperCase(),
            },
          ]
          tempData.packageCode = '803-测控基带-公共单元-下行工作频率'
        }
      }
      //上行调制器参数
      if (card == 2) {
        //上行调制器参数-载波输出控制
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '806-测控基带-载波输出控制-参数值',
              packageGridValue: this.form.OutputControl,
              basePackageGridValue: this.form.OutputControl,
            },
          ]
          tempData.packageCode = '806-测控基带-上行调制器-载波输出控制'
        }
        //上行调制器参数-载波输出电平
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '807-测控基带-载波输出电平-参数值',
              packageGridValue: this.form.OutputLevel,
              basePackageGridValue: this.form.OutputLevel,
            },
          ]
          tempData.packageCode = '807-测控基带-上行调制器-载波输出电平'
        }
      }
      //中频接收机单元遥测参数
      if (card == 3) {
        //中频接收机单元遥测参数-扩频码速率
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '804-测控基带-扩频码速率-参数值',
              packageGridValue: this.form.spreadCodeRate,
              basePackageGridValue: this.form.spreadCodeRate,
            },
          ]
          tempData.packageCode = '804-测控基带-中频接收机单元遥测-扩频码速率'
        }
      }
      //中频接收机单元测量参数
      if (card == 4) {
        //中频接收机单元测量参数-扩频码速率
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '805-测控基带-扩频码速率-参数值',
              packageGridValue: this.form.spreadCodeRate1,
              basePackageGridValue: this.form.spreadCodeRate1,
            },
          ]
          tempData.packageCode = '805-测控基带-中频接收机单元测量-扩频码速率'
        }
      }
      //上行调制器参数（遥控）
      if (card == 5) {
        //上行调制器参数（遥控）-扩频码速率
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '808-测控基带-扩频码速率-参数值',
              packageGridValue: this.form.spreadCodeRate2,
              basePackageGridValue: this.form.spreadCodeRate2,
            },
          ]
          tempData.packageCode = '808-测控基带-上行调制器 （遥控）-扩频码速率'
        }
        //上行调制器参数（遥控）-通道输出控制
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '809-测控基带-通道输出控制-参数值',
              packageGridValue: this.form.ChannelOutputControl,
              basePackageGridValue: this.form.ChannelOutputControl,
            },
          ]
          tempData.packageCode = '809-测控基带-上行调制器 （遥控）-通道输出控制'
        }
      }
      //上行调制器参数（测量）
      if (card == 6) {
        //上行调制器参数（测量）-通道输出控制
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '810-测控基带-通道输出控制-参数值',
              packageGridValue: this.form.ChannelOutputControl1,
              basePackageGridValue: this.form.ChannelOutputControl1,
            },
          ]
          tempData.packageCode = '810-测控基带-上行调制器 （测量）-通道输出控制'
        }
      } //遥控单元
      if (card == 7) {
        //遥控单元-码型
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '811-测控基带-码型-参数值',
              packageGridValue: this.form.RCpattern,
              basePackageGridValue: this.form.RCpattern,
            },
          ]
          tempData.packageCode = '811-测控基带-遥控单元-码型'
        }
        //遥控单元-码速率类型
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '812-测控基带-码速率类型-参数值',
              packageGridValue: this.form.RCcodRateType,
              basePackageGridValue: this.form.RCcodRateType,
            },
          ]
          tempData.packageCode = '812-测控基带-遥控单元-码速率类型'
        }
        //遥控单元-码速率
        if (type == 'c') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '813-测控基带-码速率-参数值',
              packageGridValue: this.form.RCcodeRate,
              basePackageGridValue: this.form.RCcodeRate,
            },
          ]
          tempData.packageCode = '813-测控基带-遥控单元-码速率'
        }
        //遥控单元-遥控工作模式
        if (type == 'd') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '814-测控基带-遥控工作模式-参数值',
              packageGridValue: this.form.RCremoteControlWorkMode,
              basePackageGridValue: this.form.RCremoteControlWorkMode,
            },
          ]
          tempData.packageCode = '814-测控基带-遥控单元-遥控工作模式'
        }
      }
      //遥测单元
      if (card == 8) {
        //遥测单元-码型
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '815-测控基带-码型-参数值',
              packageGridValue: this.form.TMpattern,
              basePackageGridValue: this.form.TMpattern,
            },
          ]
          tempData.packageCode = '815-测控基带-遥测单元-码型'
        }
        //遥测单元-码速率设置方式
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '816-测控基带-码速率设置方式-参数值',
              packageGridValue: this.form.TMCodeRateSettingMethod,
              basePackageGridValue: this.form.TMCodeRateSettingMethod,
            },
          ]
          tempData.packageCode = '816-测控基带-遥测单元-码速率设置方式'
        }
        //遥测单元-码速率
        if (type == 'c') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '817-测控基带-码速率-参数值',
              packageGridValue: this.form.TMcodeRate,
              basePackageGridValue: this.form.TMcodeRate,
            },
          ]
          tempData.packageCode = '817-测控基带-遥测单元-码速率'
        }
        //遥测单元-译码方式
        if (type == 'd') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '818-测控基带-译码方式-参数值',
              packageGridValue: this.form.TMdecodingMethod,
              basePackageGridValue: this.form.TMdecodingMethod,
            },
          ]
          tempData.packageCode = '818-测控基带-遥测单元-译码方式'
        }
        //遥测单元-卷积码类型
        if (type == 'e') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '819-测控基带-卷积码类型-参数值',
              packageGridValue: this.form.TMConvolutionalCodeType,
              basePackageGridValue: this.form.TMConvolutionalCodeType,
            },
          ]
          tempData.packageCode = '819-测控基带-遥测单元-卷积码类型'
        }
      }
      //扩频码单元参数
      if (card == 9) {
        //扩频码单元参数-上行遥控伪码初相1
        if (type == 'a') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '820-测控基带-上行遥控伪码初相1-参数值',
              packageGridValue: this.form.upRCpseudocode1,
              basePackageGridValue: this.form.upRCpseudocode1,
            },
          ]
          tempData.packageCode = '820-测控基带-扩频码单元-上行遥控伪码初相1'
        }
        //扩频码单元参数-上行遥控伪码初相2
        if (type == 'b') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '821-测控基带-上行遥控伪码初相2-参数值',
              packageGridValue: this.form.upRCpseudocode2,
              basePackageGridValue: this.form.upRCpseudocode2,
            },
          ]
          tempData.packageCode = '821-测控基带-扩频码单元-上行遥控伪码初相2'
        }
        //扩频码单元参数-上行测量伪码初相1
        if (type == 'c') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '822-测控基带-上行测量伪码初相1-参数值',
              packageGridValue: this.form.upMeasurementPseudocode1,
              basePackageGridValue: this.form.upMeasurementPseudocode1,
            },
          ]
          tempData.packageCode = '822-测控基带-扩频码单元-上行测量伪码初相1'
        }
        //扩频码单元参数-上行测量伪码初相2
        if (type == 'd') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '823-测控基带-上行测量伪码初相2-参数值',
              packageGridValue: this.form.upMeasurementPseudocode2,
              basePackageGridValue: this.form.upMeasurementPseudocode2,
            },
          ]
          tempData.packageCode = '823-测控基带-扩频码单元-上行测量伪码初相2'
        }
        //扩频码单元参数-下行遥测伪码初相1
        if (type == 'e') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '824-测控基带-下行遥测伪码初相1-参数值',
              packageGridValue: this.form.downTMpseudocode1,
              basePackageGridValue: this.form.downTMpseudocode1,
            },
          ]
          tempData.packageCode = '824-测控基带-扩频码单元-下行遥测伪码初相1'
        }
        //扩频码单元参数-下行遥测伪码初相2
        if (type == 'f') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '825-测控基带-下行遥测伪码初相2-参数值',
              packageGridValue: this.form.downTMpseudocode2,
              basePackageGridValue: this.form.downTMpseudocode2,
            },
          ]
          tempData.packageCode = '825-测控基带-扩频码单元-下行遥测伪码初相2'
        }
        //扩频码单元参数-下行测量伪码初相1
        if (type == 'g') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '826-测控基带-下行测量伪码初相1-参数值',
              packageGridValue: this.form.downMeasurementPseudocode1,
              basePackageGridValue: this.form.downMeasurementPseudocode1,
            },
          ]
          tempData.packageCode = '826-测控基带-扩频码单元-下行测量伪码初相1'
        }
        //扩频码单元参数-下行测量伪码初相2
        if (type == 'h') {
          tempData.nmcPackageGridValues = [
            {
              gridCode: '827-测控基带-下行测量伪码初相2-参数值',
              packageGridValue: this.form.downMeasurementPseudocode2,
              basePackageGridValue: this.form.downMeasurementPseudocode2,
            },
          ]
          tempData.packageCode = '827-测控基带-扩频码单元-下行测量伪码初相2'
        }
      }
      let val={card,type}
       httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val, 6)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    callback(key) {
      console.log(key)
    },
    changeBlur(val, a) {
      console.log(val.target._value, a)
      this.form.frequency2 = Number(parseFloat(val.target._value).toFixed(2))
    },
    // 开关矩阵
    conditionSwitchMatrixFilter(val) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      this.conditionSctiveFilter(val, tempData)
      const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // 如果值为数字并且小于0 则加65536 在转换为字符串
      if (!isNaN(aaa)) {
        if (Number(aaa) < 0) {
          tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
        }
      }
      tempData.nmcPackageGridValues[0].basePackageGridValue =
        tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')

      if (val == 2) {
        //输入通道，合并输出通道发送处理
        const ccc = tempData.nmcPackageGridValues[1].packageGridValue
        // 如果值为数字并且小于0 则加65536 在转换为字符串
        if (!isNaN(ccc)) {
          if (Number(ccc) < 0) {
            tempData.nmcPackageGridValues[1].packageGridValue = Number(ccc) + 65536 + ''
          }
        }
        tempData.nmcPackageGridValues[1].basePackageGridValue =
          tempData.nmcPackageGridValues[1].basePackageGridValue.join('￥')
      }

      tempData.nmcPackageGridValues.forEach((i) => {
        i.packageGridValue = i.packageGridValue.toUpperCase()
      })
      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val, 3)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    // V频段上变频器
    handleFrequencyConfig(val, precision) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      this.conditionFrequencyFilter(val, tempData, precision)
      const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // 如果值为数字并且小于0 则加65536 在转换为字符串
      if (!isNaN(aaa)) {
        if (Number(aaa) < 0) {
          tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
        }
      }
      tempData.nmcPackageGridValues[0].basePackageGridValue =
        tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')

      tempData.nmcPackageGridValues.forEach((i) => {
        i.packageGridValue = i.packageGridValue.toUpperCase()
      })
      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val, 2)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    // Q频段下变频器
    handleQFrequencyConfig(val) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      this.conditionQFrequencyFilter(val, tempData)
      const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // 如果值为数字并且小于0 则加65536 在转换为字符串
      if (!isNaN(aaa)) {
        if (Number(aaa) < 0) {
          tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
        }
      }
      tempData.nmcPackageGridValues[0].basePackageGridValue =
        tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')
      if (tempData.packageCode != '402-Q下变频-通道开关设置') {
        // tempData.nmcPackageGridValues[0].packageGridValue = '01'
        tempData.nmcPackageGridValues.forEach((i) => {
          i.packageGridValue = i.packageGridValue.toUpperCase()
        })
      } else {
        console.log(tempData, '402-Q下变频-通道开关设置')
      }

      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val, 4)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    onChange(checked) {
      console.log(`a-switch to ${checked}`)
    },
    // 单通道下变频器
    handleSingleConfig(val, p) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      this.conditionSingleFilter(val, tempData)
      const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // 如果值为数字并且小于0 则加65536 在转换为字符串
      if (!isNaN(aaa)) {
        if (Number(aaa) < 0) {
          tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
        }
      }
      tempData.nmcPackageGridValues[0].basePackageGridValue =
        tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')
      tempData.nmcPackageGridValues.forEach((i) => {
        i.packageGridValue = i.packageGridValue.toUpperCase()
      })
      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val, 5)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    sendPackageInfo(tempData,type){
        tempData.nmcPackageGridValues.forEach(item => {

              if (!isNaN(item.packageGridValue)) {
                  if (Number(item.packageGridValue) < 0) {
                    tempData.nmcPackageGridValues[0].packageGridValue = Number(item.packageGridValue) + 65536 + ''
                  }
                }
                item.basePackageGridValue =item.basePackageGridValue.join('￥')
          });
         httpAction('/device/dmDevice/sendPackage', tempData, 'post')
            .then(async (res) => {
              if (res.success) {
                this.$message.success(`发包成功！`)
                this.getEchoData(tempData)
                // this.getLatestPackageGridValue(tempData, val)
              } else {
                this.$message.error(res.message)
              }
            })
            .finally(() => {})
    },
    handleConfigKD(){
         let tempData = {
                          deviceId: this.deviceData.deviceId,
                          nmcPackageGridValues: [],
                          packageCode :'853-馈电基带-单元参数设置'
                        }

         this.conditionFilterXin(tempData)

      // const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // // 如果值为数字并且小于0 则加65536 在转换为字符串
      // if (!isNaN(aaa)) {
      //   if (Number(aaa) < 0) {
      //     tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
      //   }
      // }

      // tempData.nmcPackageGridValues[0].basePackageGridValue =
      //   tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')


        //  return

        },
    handleConfig(val) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      this.conditionFilter(val, tempData)

      const aaa = tempData.nmcPackageGridValues[0].packageGridValue
      // 如果值为数字并且小于0 则加65536 在转换为字符串
      if (!isNaN(aaa)) {
        if (Number(aaa) < 0) {
          tempData.nmcPackageGridValues[0].packageGridValue = Number(aaa) + 65536 + ''
        }
      }

      tempData.nmcPackageGridValues[0].basePackageGridValue =
        tempData.nmcPackageGridValues[0].basePackageGridValue.join('￥')

      if (tempData.packageCode != '15-网络地址配置') {
        tempData.nmcPackageGridValues[0].packageGridValue = Number(tempData.nmcPackageGridValues[0].packageGridValue)
          .toString(16)
          .toUpperCase()
        tempData.nmcPackageGridValues.forEach((i) => {
          i.packageGridValue = i.packageGridValue.toUpperCase()
        })
      }
      httpAction('/device/dmDevice/sendPackage', tempData, 'post')
        .then(async (res) => {
          if (res.success) {
            this.$message.success(`发包成功！`)
            this.getLatestPackageGridValue(tempData, val)
          } else {
            this.$message.error(res.message)
          }
        })
        .finally(() => {})
    },
    // 获取配置页全部数据
    async getRequestsAll(val) {
      let tempData = {
        deviceId: this.deviceData.deviceId,
        nmcPackageGridValues: [
          {
            gridCode: '',
            packageGridValue: '',
            basePackageGridValue: [],
          },
        ],
        packageCode: '',
      }
      // 馈电基带
      if (this.sctiveType === 'feedBaseband') {
        tempData.packageCode = '853-馈电基带-单元参数设置'
        this.getEchoData(tempData)
        // for (let i = 1; i < 18; i++) {
        //   this.conditionFilter(i, tempData)
        //   this.getLatestPackageGridValue(tempData, i, 1)

        // }
      }
      // V频段上变频器
      if (this.sctiveType === 'VBandUpconverter') {
        for (let i = 1; i < 5; i++) {
          this.conditionFrequencyFilter(i, tempData)
          this.getLatestPackageGridValue(tempData, i, 2)
        }
      }
      // 开关矩阵
      if (this.sctiveType === 'switchMatrix') {
        for (let i = 1; i < 4; i++) {
          if (i === 2) {
            //输入和输出通道合并了，只需要2，清除告警不需要查询
            this.conditionSctiveFilter(i, tempData)
            this.getLatestPackageGridValue(tempData, i, 3)
          }
        }
      }
      // Q频段下变频器
      if (this.sctiveType === 'QBandDownconverter') {
        for (let i = 1; i < 6; i++) {
          this.conditionQFrequencyFilter(i, tempData)
          this.getLatestPackageGridValue(tempData, i, 4)
        }
      }
      // 单通道下变频器
      if (this.sctiveType === 'singleChannelDownConverter') {
        for (let i = 1; i < 6; i++) {
          this.conditionSingleFilter(i, tempData)
          this.getLatestPackageGridValue(tempData, i, 5)
        }
      }
          // 测控基带
      if (this.sctiveType === 'MeasurementControlBaseband') {
        for (let i = 1; i < 28; i++) {
          this.conditionMeasureFilter(i, tempData)
          console.log(tempData,'------------tempData');
          this.getLatestPackageGridValue(tempData, i, 6)
        }
      }
      // 协议网关
      if (this.sctiveType === 'ProtocolGateway') {
        this.getConfig()
      }
    },
    //获取设备某个包的某个工程量的最新值
    async getLatestPackageGridValue(row, val, dis) {

      // console.log(row,val,dis,'============是否是3');
      const tempData = {
        deviceId: this.deviceData.deviceId,
        gridCode: row.nmcPackageGridValues[0].gridCode,
        packageCode: row.packageCode,
      }
      if (dis === 3) {
        delete tempData.gridCode

        const { success, result, message } = await getAction('/device/dmDevice/getLatestPackageGridValues', tempData)
        if (success) {
          if (result.basePackageGridValue) {
            result.basePackageGridValue = result.basePackageGridValue.split('￥')
          } else {
            result.basePackageGridValue = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
          }
          if (dis === 3) {
            //开关矩阵
            this.echoDataFilter2(result, val)
          }
        } else {
          this.$message.error(message)
        }
      } else {
        // console.log(tempData,'ce空参数');
        const { success, result, message } = await getAction('/device/dmDevice/getLatestPackageGridValue', tempData)
        if (success) {
          if(dis===6){
            console.log('测控基带',result);
            //测控基带
            this.echoDataFilter5(result, val)
          }else{
              if (result.basePackageGridValue) {
                    result.basePackageGridValue = result.basePackageGridValue.split('￥')
               } else {
                   result.basePackageGridValue = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
               }
               if (dis === 1) {
                 //馈电基带
                 this.echoDataFilter(result, val)
               } else if (dis === 2) {
                 //V频段上变频器
                 this.echoDataFilter1(result, val)
               } else if (dis === 3) {
                 //开关矩阵
                 this.echoDataFilter2(result, val)
               } else if (dis === 4) {
                 //Q频段下变频器
                 this.echoDataFilter3(result, val)
               } else if (dis === 5) {
                //单通道下变频器
                 this.echoDataFilter4(result, val)
               }
              }
        } else {
          this.$message.error(message)
        }
      }
    },
    // 按长度补零
    zeroFill(str, signed, length, precision) {
      // str(字符串), signed(是否添加正负), length(字节长度),precision(精度)
      if (signed) {
        str = str < 0 ? `${str}` : `+${str}`
        let newLength = str.length
        if (str.length < length) {
          for (let i = 1; i <= length - newLength; i++) {
            str = str.slice(0, 1) + '0' + str.slice(1)
          }
        }
      } else {
        // console.log(str, 'str补零后2')
        let newLength = str.length
        // console.log(newLength, 'newLength')
        // console.log(str.length, 'str.length')
        if (str.length < length) {
          for (let i = 1; i <= length - newLength; i++) {
            str = str.slice(0, 0) + '0' + str.slice(0)
          }
        }
        // console.log(str, '11111111111')
      }
      // console.log(str, 'str补零后')
      return str
    },
    // 使用charCodeAt将字符串转换成ASCII的十进制数字，再用toString(16)转成16进制
    numToASCIIString(str, signed, length) {
      // console.log(str, '----', signed, length)
      return str ? str.charCodeAt().toString(16).toUpperCase() : ''
    },
    ASCIITonumString(str) {
      return str ? String.fromCharCode(parseInt(str, 16)) : ''
    },
    changeThoroughfare(val, type) {
      // console.log('该不安', val, type)
      // 需要请求该通道的偏移量，需要接口
      // return
      //1是v上 2是q下
      if (type == 1) {
        if (val == 1) {
          this.Basicvalue = '46100M+'
        } else if (val == 2) {
          this.Basicvalue = '47100M+'
        } else if (val == 3) {
          this.Basicvalue = '47775M+'
        }
      }
      if (type == 2) {
        if (val == 1) {
          this.Basicvalue = '36400M+'
        } else if (val == 2) {
          this.Basicvalue = '37400M+'
        } else if (val == 3) {
          this.Basicvalue = '37900M+'
        }
      }
    },

    // 馈电基带回显参数(xin)
    getEchoData(tempData){
      // tempData.nmcPackageGridValues.forEach(element => {
        let data={deviceId:tempData.deviceId,packageCode:tempData.packageCode	}
      // });
      getAction('/device/dmDevice/getLatestPackageGridValues', data).then(res=>{
        if(res.success){
          // console.log(res,'馈电基带的包的最新值')
          this.echoDataFilterXin(res.result)
        }
      })
    },
    echoDataFilterXin(data){
      data.forEach(i=>{
        if(i.gridCode=="853-馈电基带-数据域-启动开关状态"){
          this.form.parameter1 = i.packageGridValue =='01' ? true : false
        }else if(i.gridCode=="853-馈电基带-数据域-下行中心频点"){
          // basePackageGridValue packageGridValue
            this.form.parameter8 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-下行符号速率"){
          // basePackageGridValue packageGridValue
            this.form.parameter9 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-下行调制编码模式"){
          // basePackageGridValue packageGridValue
            this.form.parameter10 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-卫星调制编码组合"){
          // basePackageGridValue packageGridValue
            this.form.parameter19 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-上行中心频点"){
          // basePackageGridValue packageGridValue
            this.form.parameter3 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-上行符号速率"){
          // basePackageGridValue packageGridValue
            this.form.parameter4 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-上行调制编码模式"){
          // basePackageGridValue packageGridValue
            this.form.parameter5 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-基带调制编码组合"){
          // basePackageGridValue packageGridValue
            this.form.parameter6 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-上行调整功率模式"){
          // basePackageGridValue packageGridValue
            this.form.parameter7 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-上行发送功率"){
          // basePackageGridValue packageGridValue
            this.form.parameter2 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-单载波和调制信号切换状态"){
          // basePackageGridValue packageGridValue
            this.form.parameter14 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-频偏预补偿开关状态"){
          // basePackageGridValue packageGridValue
            this.form.parameter13 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-频偏预补偿值"){
          // basePackageGridValue packageGridValue
            this.form.parameter12 = i.basePackageGridValue
        }else if(i.gridCode=="853-馈电基带-数据域-频谱倒置"){
          // basePackageGridValue packageGridValue
            this.form.parameter18 = i.basePackageGridValue
        }

      })

    },
    // 馈电基带回显参数
    // echoDataFilter(row, val) {
    //   //启动开关
    //   if (val == 1) {
    //     console.log(row)
    //     this.form.parameter1 = row.basePackageGridValue[0] === 'true' ? true : false
    //     return
    //   }
    //   //上行功率(步进单位 0.1dbm，当量1000范围参照《技术要求》)
    //   if (val == 2) {
    //     this.form.parameter2 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //上行中心频点
    //   if (val == 3) {
    //     this.form.parameter3 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //上行符号速率
    //   if (val == 4) {
    //     this.form.parameter4 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //上行调制编码模式
    //   if (val == 5) {
    //     this.form.parameter5 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //上行调制编码组合
    //   if (val == 6) {
    //     this.form.parameter6 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //上行调整功率模式
    //   if (val == 7) {
    //     this.form.parameter7 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //下行中心频点
    //   if (val == 8) {
    //     this.form.parameter8 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //下行符号速率
    //   if (val == 9) {
    //     this.form.parameter9 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //下行调制编码组合
    //   if (val == 10) {
    //     this.form.parameter10 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //误码率清零
    //   if (val == 11) {
    //     this.form.parameter11 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //频偏预补偿值
    //   if (val == 12) {
    //     this.form.parameter12 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //频偏预补偿开关
    //   if (val == 13) {
    //     this.form.parameter13 = row.basePackageGridValue[0]
    //     return
    //   }
    //   //单载波和调制信号切换
    //   if (val == 14) {
    //     this.form.parameter14 = row.basePackageGridValue[0]
    //     return
    //   }
    //   console.log(row, 'row')
    //   // //业务网络IP地址
    //   // if (val == 15) {
    //   //   this.form.parameter15 = row.basePackageGridValue[0]
    //   //   return
    //   // }
    //   // //业务网络端口号
    //   // if (val == 16) {
    //   //   this.form.parameter16 = row.basePackageGridValue[1]
    //   //   return
    //   // }
    //   //业务网络子网掩码
    //   if (val == 17) {
    //     this.form.parameter15 = row.basePackageGridValue[0]
    //     this.form.parameter16 = row.basePackageGridValue[1]
    //     this.form.parameter17 = row.basePackageGridValue[2]
    //     return
    //   }
    // },
    // V频段上变频器回显参数
    echoDataFilter1(row, val) {
      //增益设置
      if (val == 1) {
        this.form.frequency1 = row.basePackageGridValue[0]
        this.form.frequency2 = row.basePackageGridValue[1]
        return
      }
      //通道开关
      if (val == 2) {
        this.form.frequency3 = row.basePackageGridValue[0]
        this.form.frequency4 = row.basePackageGridValue[1]
        return
      }
      //本振偏移量设置
      if (val == 3) {
        this.form.frequency5 = row.basePackageGridValue[0]
        this.form.frequency6 = row.basePackageGridValue[1]
        return
      }
    },
    // 开关矩阵回显参数
    echoDataFilter2(row, val) {
      row.forEach((item) => {
        //输入通道
        if (item.gridCode == '200-开关矩阵-参数体值') {
          this.form.switchMatrix1 = Number(item.basePackageGridValue || 0)
        }
        //输出通道
        if (item.gridCode == '200-开关矩阵-控制输出通道') {
          this.form.switchMatrix2 = Number(item.basePackageGridValue || 0)
        }
      })
    },
    // Q频段下变频器回显参数
    echoDataFilter3(row, val) {
      // console.log(row, 'rrrrrrrrrrrr', val)
      //输出功率
      if (val == 1) {
        this.form.qFrequency1 = row.basePackageGridValue[0]
        this.form.qFrequency2 = row.basePackageGridValue[1]
        return
      }
      //通道开关
      if (val == 2) {
        this.form.frequency3 = row.basePackageGridValue[0]
        this.form.frequency4 = row.basePackageGridValue[1]
        return
      }
      //增益设置
      if (val == 3) {
        this.form.qFrequency5 = row.basePackageGridValue[0]
        this.form.qFrequency6 = row.basePackageGridValue[1]
        return
      }
      //本振偏移量设置
      if (val == 4) {
        this.form.qFequency7 = row.basePackageGridValue[0]
        this.form.qFequency8 = row.basePackageGridValue[1]
        return
      }
    },
    // 单通道下变频器回显参数
    echoDataFilter4(row, val) {
      //输出功率
      if (val == 1) {
        this.form.single1 = row.basePackageGridValue[0]
        this.form.single2 = row.basePackageGridValue[1]
        return
        return
      }
      //通道开关
      if (val == 2) {
        this.form.single3 = row.basePackageGridValue[0]
        this.form.single4 = row.basePackageGridValue[1]
        return
      }
      //增益设置
      if (val == 3) {
        this.form.single5 = row.basePackageGridValue[0]
        this.form.single6 = row.basePackageGridValue[1]
        return
      }
      //本振偏移量设置
      if (val == 4) {
        this.form.single7 = row.basePackageGridValue[0]
        this.form.single8 = row.basePackageGridValue[1]
        return
      }
    },
      // 测控基带回显参数
    echoDataFilter5(row, val) {
      console.log(row,val,'-=-=-111111=-');
      if (val == 1) {
        this.form.taskID = row.basePackageGridValue
        return
      }
      if (val == 2) {
        this.form.UpWworkFrequency =row.basePackageGridValue
        // this.form.UpWworkFrequency =row.basePackageGridValue?parseInt(row.basePackageGridValue, 16):"/"
        return
      }
      if (val == 3) {
        this.form.DownWworkFrequency = row.basePackageGridValue
        // this.form.DownWworkFrequency = row.basePackageGridValue?parseInt(row.basePackageGridValue, 16):"/"
        return
      }
      if (val == 4) {
        this.form.OutputControl = row.basePackageGridValue
        return
      }
      if (val == 5) {
        this.form.OutputLevel = row.basePackageGridValue
        return
      }
      if (val == 6) {
        this.form.spreadCodeRate = row.basePackageGridValue
        return
      }
      if (val == 7) {
        this.form.spreadCodeRate1 = row.basePackageGridValue
        return
      }
      if (val == 8) {
        this.form.spreadCodeRate2 = row.basePackageGridValue
        return
      }
      if (val == 9) {
        this.form.ChannelOutputControl = row.basePackageGridValue
        return
      }
      if (val == 10) {
        this.form.ChannelOutputControl1 = row.basePackageGridValue
        return
      }
      if (val == 11) {
        this.form.RCpattern = row.basePackageGridValue
        return
      }
      if (val == 12) {
        this.form.RCcodRateType = row.basePackageGridValue
        return
      }
      if (val == 13) {
        this.form.RCcodeRate = row.basePackageGridValue
        return
      }
      if (val == 14) {
        this.form.RCremoteControlWorkMode = row.basePackageGridValue
        return
      }
      if (val == 15) {
        this.form.TMpattern = row.basePackageGridValue
        return
      }
      if (val == 16) {
        this.form.TMCodeRateSettingMethod = row.basePackageGridValue
        return
      }
      if (val == 17) {
        this.form.TMcodeRate = row.basePackageGridValue
        return
      }
      if (val == 18) {
        this.form.TMdecodingMethod = row.basePackageGridValue
        return
      }
      if (val == 19) {
        this.form.TMConvolutionalCodeType = row.basePackageGridValue
        return
      }
      if (val == 20) {
        this.form.upRCpseudocode1 = row.basePackageGridValue
        return
      }
      if (val == 21) {
        this.form.upRCpseudocode2 = row.basePackageGridValue
        return
      }
      if (val == 22) {
        this.form.upMeasurementPseudocode1 = row.basePackageGridValue
        return
      }
      if (val == 23) {
        this.form.upMeasurementPseudocode2 = row.basePackageGridValue
        return
      }
      if (val == 24) {
        this.form.downTMpseudocode1 = row.basePackageGridValue
        return
      }
      if (val == 25) {
        this.form.downTMpseudocode2 = row.basePackageGridValue
        return
      }
      if (val == 26) {
        this.form.downMeasurementPseudocode1 = row.basePackageGridValue
        return
      }
      if (val == 27) {
        this.form.downMeasurementPseudocode2 = row.basePackageGridValue
        return
      }


    },
    // 处理请求参数
    conditionSingleFilter(val, tempData) {
      //输出功率
      if (val == 1) {
        let value = this.form.single1 + this.form.single2
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '501-单通道-输出功率参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.single1, this.form.single2],
          },
        ]
        tempData.packageCode = '501-单通道-输出功率设置'
        return
      }
      //通道开关
      if (val == 2) {
        let value = this.form.single3 + this.form.single4
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '402-Q下变频-通道开关参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.single3, this.form.single4],
          },
        ]
        tempData.packageCode = '402-Q下变频-通道开关设置'
        return
      }
      //增益设置
      if (val == 3) {
        let value = this.form.single5 + this.form.single6
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '502-单通道-增益设置参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.single5, this.form.single6],
          },
        ]
        tempData.packageCode = '502-单通道-增益设置'
        return
      }
      //本振偏移量设置
      if (val == 4) {
        let value = this.form.single7 + this.form.single8
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '503-单通道-本振偏移量参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.single7, this.form.single8],
          },
        ]
        tempData.packageCode = '503-单通道-本振偏移量'
        return
      }
      //清除告警
      if (val == 5) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '504-单通道-清除告警参数值',
            packageGridValue: '00',
            basePackageGridValue: ['00'],
          },
        ]
        tempData.packageCode = '504-单通道-清除告警'
        return
      }
    },
    // 处理请求参数
    conditionQFrequencyFilter(val, tempData) {
      //输出功率
      if (val == 1) {
        // let value = this.form.qFrequency1 + this.form.qFrequency2
        // let newVal = ''
        // for (let i in value) {
        //   newVal += this.numToASCIIString(value[i])
        // }
        let str = this.zeroFill(this.form.qFrequency2, true, 5)
        let value = this.form.qFrequency1 + str
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i], i, 5)
        }

        tempData.nmcPackageGridValues = [
          {
            gridCode: '401-Q下变频-输出功率参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.qFrequency1, this.form.qFrequency2],
          },
        ]
        tempData.packageCode = '401-Q下变频-输出功率设置'
        return
      }
      //通道开关
      if (val == 2) {
        let value = this.form.frequency3 + this.form.frequency4
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '402-Q下变频-通道开关参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.frequency3, this.form.frequency4],
          },
        ]
        tempData.packageCode = '402-Q下变频-通道开关设置'
        // console.log(tempData, 'tempDatatempDatatempDatatempData')
        return
      }
      //增益设置
      if (val == 3) {
        let str = this.zeroFill(this.form.qFrequency6, false, 5)
        let value = this.form.qFrequency5 + str
        let newVal = ''
        // console.log(this.form.qFrequency5, str, 'qFrequency5 +qFrequency6')
        for (let i in value) {
          newVal += this.numToASCIIString(value[i], i, 5)
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '403-Q下变频-增益参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.qFrequency5, this.form.qFrequency6],
          },
        ]
        tempData.packageCode = '403-Q下变频-增益设置'
        return
      }
      //本振偏移量设置
      if (val == 4) {
        let str = this.zeroFill(this.form.qFrequency8, true, 6)
        let value = this.form.qFrequency7 + str
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i], i, 6)
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '404-Q下变频-本振偏移参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.qFrequency7, this.form.qFrequency8],
          },
        ]
        tempData.packageCode = '404-Q下变频-本振偏移量设置'
        return
      }
      //清除告警
      if (val == 5) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '405-Q下变频-清除告警参数值',
            packageGridValue: '00',
            basePackageGridValue: ['00'],
          },
        ]
        tempData.packageCode = '405-Q下变频-清除告警'
        return
      }
    },
    // 处理请求参数
    conditionSctiveFilter(val, tempData) {
      // if (val === 1) {
      //   tempData.nmcPackageGridValues = [
      //     {
      //       gridCode: '200-开关矩阵-参数体值',
      //       packageGridValue: this.form.switchMatrix1.toString(16),
      //       basePackageGridValue: [this.form.switchMatrix1],
      //     },
      //   ]
      //   tempData.packageCode = '200-开关矩阵-输出通道控制'
      //   return
      // }
      if (val === 2) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '200-开关矩阵-参数体值',
            packageGridValue: this.form.switchMatrix1.toString(16).toUpperCase(),
            basePackageGridValue: [this.form.switchMatrix1],
          },
          {
            gridCode: '200-开关矩阵-控制输出通道',
            packageGridValue: this.form.switchMatrix2.toString(16).toUpperCase(),
            basePackageGridValue: [this.form.switchMatrix2],
          },
        ]
        tempData.packageCode = '200-开关矩阵-输出通道控制'
        return
      }
      if (val === 3) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '202-开关矩阵-清除告警值',
            packageGridValue: '00',
            basePackageGridValue: ['00'],
          },
        ]
        tempData.packageCode = '202-开关矩阵-清除告警'
        return
      }
    },
    // 处理请求参数
    conditionFrequencyFilter(val, tempData, precision) {
      //增益设置
      if (val == 1) {
        let str = this.zeroFill(String(this.form.frequency2), false, 5, precision)
        let value = this.form.frequency1 + str
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i], i, 5)
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '302-V上变频-增益参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.frequency1, this.form.frequency2],
          },
        ]
        tempData.packageCode = '302-V上变频-增益设置'
        return
      }
      //通道开关
      if (val == 2) {
        let value = this.form.frequency3 + this.form.frequency4
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i])
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '301-V上变频-通道开关参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.frequency3, this.form.frequency4],
          },
        ]
        tempData.packageCode = '301-V上变频-通道开关'
        return
      }
      //本振偏移量设置
      if (val == 3) {
        let str = this.zeroFill(String(this.form.frequency6), false, 5)
        let value = this.form.frequency5 + str
        let newVal = ''
        for (let i in value) {
          newVal += this.numToASCIIString(value[i], i, 5)
        }
        tempData.nmcPackageGridValues = [
          {
            gridCode: '303-V上变频-本振偏移参数值',
            packageGridValue: newVal,
            basePackageGridValue: [this.form.frequency5, this.form.frequency6],
          },
        ]
        tempData.packageCode = '303-V上变频-本振偏移设置'
        return
      }
      //清除告警
      if (val == 4) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '304-V上变频-清除告警参数值',
            packageGridValue: '00',
            basePackageGridValue: ['00'],
          },
        ]
        tempData.packageCode = '304-V上变频-清除告警'
        return
      }
    },
    filterJDNo(val){
      if(val==2){
        return 1
      }else if(val==3){
        return 2
      }else if(val==4){
        return 3
      }else if(val==5){
        return 4
      }
    },
    handleConfigWML(){

      let data={
         deviceId: this.deviceData.deviceId,
          nmcPackageGridValues: [
            {
              gridCode: '855-馈电基带-基带单元-误码对比清零-通道选择',
              packageGridValue:this.filterJDNo(this.form.JDNo),
              basePackageGridValue: [this.form.JDNo],
            },
          ],
          packageCode: '856-馈电基带-误码对比清零',
      }
         this.sendPackageInfo(data)
    },
    conditionFilterXin( tempData){
      tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-启动开关状态',
            packageGridValue: this.form.parameter1 ? '01' : '00',
            basePackageGridValue: [this.form.parameter1],
          },
      )
      tempData.nmcPackageGridValues.push(
          {
            gridCode: '853-馈电基带-数据域-下行中心频点',
            packageGridValue: this.form.parameter8,
            basePackageGridValue: [this.form.parameter8],
          },
      )
       tempData.nmcPackageGridValues.push(
          {
            gridCode: '853-馈电基带-数据域-下行符号速率',
            packageGridValue: this.form.parameter9,
            basePackageGridValue: [this.form.parameter9],
          },
      )
      tempData.nmcPackageGridValues.push(
          {
            gridCode: '853-馈电基带-数据域-下行调制编码模式',
            packageGridValue: this.form.parameter10,
            basePackageGridValue: [this.form.parameter10],
          },
      )
      tempData.nmcPackageGridValues.push(
          {
            gridCode: '853-馈电基带-数据域-卫星调制编码组合',
            packageGridValue: this.form.parameter19,
            basePackageGridValue: [this.form.parameter19],
            // 暂无
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-上行中心频点',
            packageGridValue: this.form.parameter3,
            basePackageGridValue: [this.form.parameter3],
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-上行符号速率',
            packageGridValue: this.form.parameter4,
            basePackageGridValue: [this.form.parameter4],
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-上行调制编码模式',
            packageGridValue: this.form.parameter5,
            basePackageGridValue: [this.form.parameter5],
          },
      )
      tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-基带调制编码组合',
            packageGridValue: this.form.parameter6,
            basePackageGridValue: [this.form.parameter6],
          },
      )
      tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-上行调整功率模式',
            packageGridValue: this.form.parameter7,
            basePackageGridValue: [this.form.parameter7],
          },
      )
      tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-上行发送功率',
            packageGridValue: this.form.parameter2 * 1000,
            basePackageGridValue: [this.form.parameter2],
          },
      )
      tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-单载波和调制信号切换状态',
            packageGridValue: this.form.parameter14,
            basePackageGridValue: [this.form.parameter14],
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-频偏预补偿开关状态',
            packageGridValue: this.form.parameter13,
            basePackageGridValue: [this.form.parameter13],
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-频偏预补偿值',
            packageGridValue: this.form.parameter12,
            basePackageGridValue: [this.form.parameter12],
          },
      )
       tempData.nmcPackageGridValues.push(
         {
            gridCode: '853-馈电基带-数据域-频谱倒置',
            packageGridValue: this.form.parameter18,
            basePackageGridValue: [this.form.parameter18],
          },
      )
      this.sendPackageInfo(tempData,'KDJD')

       },
    // 处理请求参数
    conditionFilter(val, tempData) {
      //启动开关
      if (val == 1) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '853-馈电基带-数据域-启动开关状态',
            packageGridValue: this.form.parameter1 ? '01' : '00',
            basePackageGridValue: [this.form.parameter1],
          },
        ]
        tempData.packageCode = '853-馈电基带-单元参数设置'
        return
      }
      //上行功率
      if (val == 2) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '853-馈电基带-数据域-上行发送功率',
            packageGridValue: this.form.parameter2 * 1000,
            basePackageGridValue: [this.form.parameter2],
          },
        ]
        tempData.packageCode = '853-馈电基带-单元参数设置'
        return
      }
      //上行中心频点
      if (val == 3) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '5-上行中心频点参数体',
            packageGridValue: this.form.parameter3,
            basePackageGridValue: [this.form.parameter3],
          },
        ]
        tempData.packageCode = '5-上行中心频点'
        return
      }
      //上行符号速率
      if (val == 4) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '上行码率',
            packageGridValue: this.form.parameter4,
            basePackageGridValue: [this.form.parameter4],
          },
        ]
        tempData.packageCode = '6-上行符号速率包'
        return
      }
      //上行调制编码模式
      if (val == 5) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '上行调制编码模式参数值',
            packageGridValue: this.form.parameter5,
            basePackageGridValue: [this.form.parameter5],
          },
        ]
        tempData.packageCode = '7-上行调制编码模式'
        return
      }
      //上行调制编码组合
      if (val == 6) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '上行调制编码组合参数值',
            packageGridValue: this.form.parameter6,
            basePackageGridValue: [this.form.parameter6],
          },
        ]
        tempData.packageCode = '8-上行调制编码组合'
        return
      }
      //上行调整功率模式
      if (val == 7) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '上行调整功率模式参数值',
            packageGridValue: this.form.parameter7,
            basePackageGridValue: [this.form.parameter7],
          },
        ]
        tempData.packageCode = '9-上行调整功率模式'
        return
      }
      //下行中心频点
      if (val == 8) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '下行中心频点参数值',
            packageGridValue: this.form.parameter8,
            basePackageGridValue: [this.form.parameter8],
          },
        ]
        tempData.packageCode = '2-下行中心频点'
        return
      }
      //下行符号速率
      if (val == 9) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '下行符号速率参数值',
            packageGridValue: this.form.parameter9,
            basePackageGridValue: [this.form.parameter9],
          },
        ]
        tempData.packageCode = '3-下行符号速率'
        return
      }
      //下行调制编码组合
      if (val == 10) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '下行调制编码组合参数值',
            packageGridValue: this.form.parameter10,
            basePackageGridValue: [this.form.parameter10],
          },
        ]
        tempData.packageCode = '4-下行调制编码组合'
        return
      }
      //误码率清零
      if (val == 11) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '误码率清零参数值',
            packageGridValue: '01',
            basePackageGridValue: ['01'],
          },
        ]
        tempData.packageCode = '14-误码率清零'
        return
      }
      //频偏预补偿值
      if (val == 12) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '频偏预补偿值参数值',
            packageGridValue: this.form.parameter12,
            basePackageGridValue: [this.form.parameter12],
          },
        ]
        tempData.packageCode = '13-频偏预补偿值'
        return
      }
      //频偏预补偿开关
      if (val == 13) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '频偏预补偿开关参数值',
            packageGridValue: this.form.parameter13,
            basePackageGridValue: [this.form.parameter13],
          },
        ]
        tempData.packageCode = '12-频偏预补偿开关'
        return
      }
      //单载波和调制信号切换
      if (val == 14) {
        tempData.nmcPackageGridValues = [
          {
            gridCode: '载波调制频谱参数值',
            packageGridValue: this.form.parameter14,
            basePackageGridValue: [this.form.parameter14],
          },
        ]
        tempData.packageCode = '11-单载波调制频谱'
        return
      }
      //业务网络IP地址
      // if (val == 15) {
      //   tempData.nmcPackageGridValues = [
      //     {
      //       gridCode: '启动开关参数值',
      //       packageGridValue: this.form.parameter15,
      //       basePackageGridValue: [this.form.parameter15]
      //     },
      //   ]
      //   tempData.packageCode = '1-启动开关'
      //   return
      // }
      //业务网络端口号
      // if (val == 16) {
      //   tempData.nmcPackageGridValues = [
      //     {
      //       gridCode: '启动开关参数值',
      //       packageGridValue: this.form.parameter16,
      //       basePackageGridValue: [this.form.parameter16]
      //     },
      //   ]
      //   tempData.packageCode = '1-启动开关'
      //   return
      // }
      //业务网络子网掩码 与15，16合并
      if (val == 17) {
        let str = ''
        let ip = this.ToHex(this.form.parameter15, 2)
        let port = this.ToHex(this.form.parameter16, 4)
        let mask = this.ToHex(this.form.parameter17, 2)
        tempData.nmcPackageGridValues = [
          {
            gridCode: '15-网络地址配置参数体',
            packageGridValue: ip + '' + mask + '' + port + '',
            basePackageGridValue: [this.form.parameter15, this.form.parameter16, this.form.parameter17],
          },
        ]
        tempData.packageCode = '15-网络地址配置'
        return
      }
    },
    onSubmit() {
      // console.log('submit!', this.sctiveType)
      if (this.sctiveType == 'ProtocolGateway') {
        let str = (Number(this.form.antenna) - 1) * 4 + Number(this.form.thoroughfare)
        let result = str.toString(16).toUpperCase().padStart(2, 0)
        // console.log(result, '协议网关关键字')
      }
    },
    ToHex(str, num) {
      let temp = str ? str.split('.') : []
      let res = ''
      temp.forEach((i) => {
        res += Number(i).toString(16).toUpperCase().padStart(num, 0)
      })
      return res
    },
    getConfig() {
      const tempData = {
        deviceId: this.deviceData.deviceId,
        packageCode: '101-协议网关-天线通道',
      }
      getAction('/device/dmDevice/getLatestPackageGridValues', tempData)
        .then((res) => {
          if (res.success) {
            res.result.forEach((item) => {
              if (item.basePackageGridValue) {
                item.basePackageGridValue = item.basePackageGridValue.split('￥')
              }
              if (item.gridCode == '101-协议网关-调制IP') {
                // let arr = ''
                // let k = 0
                // for (let i = 0; i < item.packageGridValue.length; i++) {
                //   if (item.packageGridValue.length > k) {
                //     let ss = item.packageGridValue.substring(k, k + 2)
                //     if (arr) {
                //       arr = arr + '.' + parseInt(ss, 16)
                //     } else {
                //       arr = arr + parseInt(ss, 16)
                //     }
                //     k += 2
                //   }
                // }
                this.form.modulationIP = item.basePackageGridValue[0]
              }
              if (item.gridCode == '101-协议网关-解调IP') {
                // let arr = ''
                // let k = 0
                // for (let i = 0; i < item.packageGridValue.length; i++) {
                //   if (item.packageGridValue.length > k) {
                //     let ss = item.packageGridValue.substring(k, k + 2)
                //     if (arr) {
                //       arr = arr + '.' + parseInt(ss, 16)
                //     } else {
                //       arr = arr + parseInt(ss, 16)
                //     }
                //     k += 2
                //   }
                // }
                this.form.demodulationIP = item.basePackageGridValue[0]
              }
              if (item.gridCode == '101-协议网关-关键字') {
                // let ss = item.packageGridValue.substring(0, 2)
                // this.form.antenna = parseInt(ss, 16)
                // let ss1 = item.packageGridValue.substring(2, 4)
                // this.form.thoroughfare = parseInt(ss1, 16)
                this.form.antenna = item.basePackageGridValue[0]
                this.form.thoroughfare = item.basePackageGridValue[1]
              }
            })
          }
        })
        .finally(() => {})
    },
    onSubmit1() {
      if (this.sctiveType == 'ProtocolGateway') {
        // 处理关键字转16进制
        let str = (Number(this.form.antenna) - 1) * 4 + Number(this.form.thoroughfare)
        let result = str.toString(16).toUpperCase().padStart(2, 0)
        // 调制IP转16进制
        let aa = this.form.modulationIP.split('.')
        let str1 = ''
        aa.forEach((item) => {
          str1 += Number(item).toString(16).toUpperCase().padStart(2, 0)
        })
        // 解调IP转16进制
        let bb = this.form.demodulationIP.split('.')
        let str2 = ''
        bb.forEach((item) => {
          str2 += Number(item).toString(16).toUpperCase().padStart(2, 0)
        })
        const tempData = {
          deviceId: this.deviceData.deviceId,
          nmcPackageGridValues: [
            {
              gridCode: '101-协议网关-关键字',
              packageGridValue: '10' + result,
              basePackageGridValue: [this.form.antenna, this.form.thoroughfare].join('￥'),
            },
            {
              gridCode: '101-协议网关-调制IP',
              packageGridValue: str1,
              basePackageGridValue: [this.form.modulationIP].join('￥'),
            },
            {
              gridCode: '101-协议网关-解调IP',
              packageGridValue: str2,
              basePackageGridValue: [this.form.demodulationIP].join('￥'),
            },
          ],
          packageCode: '101-协议网关-天线通道',
        }

        tempData.nmcPackageGridValues.forEach((i) => {
          i.packageGridValue = i.packageGridValue.toUpperCase()
        })
        httpAction('/device/dmDevice/sendPackage', tempData, 'post')
          .then((res) => {
            if (res.success) {
              this.$message.success(`发包成功！`)
              this.getConfig()
            }
          })
          .finally(() => {})
      }
    },
  },
}
</script>

<style lang="less" scoped>

.matrixTable {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin:auto
}

.matrixTable, th, td {
  border: 1px solid black;
  width: 240px;
  max-width: 240px; 
  height: 50px;
  max-height: 60px;
  
}
.matrixTable {
   td:first-child, th:first-child{

     width: 100px !important;
   }
  /* 设置第一列的样式 */
}
.prohibit {
  pointer-events: none;
}
.prohibit-cu {
  cursor: not-allowed !important;
}
</style>
